{
 "cells": [
  {
   "cell_type": "code",
   "execution_count": 1,
   "id": "9a082ec0",
   "metadata": {},
   "outputs": [],
   "source": [
    "import csv"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 2,
   "id": "2409665c",
   "metadata": {},
   "outputs": [],
   "source": [
    "with open('examples/ex7.csv') as f:\n",
    "    lines = list(csv.reader(f))"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 3,
   "id": "70b1fabb",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "[['a', 'b', 'c'], ['1', '2', '3'], ['1', '2', '3']]"
      ]
     },
     "execution_count": 3,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "lines"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 4,
   "id": "4483de5e",
   "metadata": {},
   "outputs": [],
   "source": [
    "header, values = lines[0], lines[1:]"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 5,
   "id": "0ac1c242",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "[['1', '2', '3'], ['1', '2', '3']]"
      ]
     },
     "execution_count": 5,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "values"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 6,
   "id": "600604cc",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "['a', 'b', 'c']"
      ]
     },
     "execution_count": 6,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "header"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 7,
   "id": "35b4be3c",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "<zip at 0x172fdf8f880>"
      ]
     },
     "execution_count": 7,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "zip(*values)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 8,
   "id": "d9ec166b",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "[('1', '1'), ('2', '2'), ('3', '3')]"
      ]
     },
     "execution_count": 8,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "list(zip(*values))"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 9,
   "id": "ae10b25e",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "[('a', '1', '1'), ('b', '2', '2'), ('c', '3', '3')]"
      ]
     },
     "execution_count": 9,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "list(zip(*lines))"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 10,
   "id": "38fd190f",
   "metadata": {},
   "outputs": [],
   "source": [
    "data_dic = {h: v for h, v in zip(header, zip(*values))}"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 11,
   "id": "eeb53306",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "{'a': ('1', '1'), 'b': ('2', '2'), 'c': ('3', '3')}"
      ]
     },
     "execution_count": 11,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "data_dic"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 12,
   "id": "7e077a9e",
   "metadata": {},
   "outputs": [
    {
     "ename": "SyntaxError",
     "evalue": "unexpected EOF while parsing (164063274.py, line 1)",
     "output_type": "error",
     "traceback": [
      "\u001b[1;36m  Cell \u001b[1;32mIn[12], line 1\u001b[1;36m\u001b[0m\n\u001b[1;33m    class my_dialect(csv.Dialect):\u001b[0m\n\u001b[1;37m                                  ^\u001b[0m\n\u001b[1;31mSyntaxError\u001b[0m\u001b[1;31m:\u001b[0m unexpected EOF while parsing\n"
     ]
    }
   ],
   "source": [
    "class my_dialect(csv.Dialect):"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 13,
   "id": "6b0a0849",
   "metadata": {},
   "outputs": [],
   "source": [
    "class my_dialect(csv.Dialect):\n",
    "    lineterminator = '\\n'\n",
    "    delimiter = ';'\n",
    "    quotechar = '\"\"'\n",
    "    quoting = csv.QUOTE_MINIMAL"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 14,
   "id": "273bc174",
   "metadata": {},
   "outputs": [
    {
     "ename": "NameError",
     "evalue": "name 'mydialect' is not defined",
     "output_type": "error",
     "traceback": [
      "\u001b[1;31m---------------------------------------------------------------------------\u001b[0m",
      "\u001b[1;31mNameError\u001b[0m                                 Traceback (most recent call last)",
      "Cell \u001b[1;32mIn[14], line 1\u001b[0m\n\u001b[1;32m----> 1\u001b[0m reader \u001b[38;5;241m=\u001b[39m csv\u001b[38;5;241m.\u001b[39mreader(f, dialect\u001b[38;5;241m=\u001b[39m\u001b[43mmydialect\u001b[49m)\n",
      "\u001b[1;31mNameError\u001b[0m: name 'mydialect' is not defined"
     ]
    }
   ],
   "source": [
    "reader = csv.reader(f, dialect=mydialect)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 15,
   "id": "b762b0de",
   "metadata": {},
   "outputs": [
    {
     "ename": "ValueError",
     "evalue": "I/O operation on closed file.",
     "output_type": "error",
     "traceback": [
      "\u001b[1;31m---------------------------------------------------------------------------\u001b[0m",
      "\u001b[1;31mValueError\u001b[0m                                Traceback (most recent call last)",
      "Cell \u001b[1;32mIn[15], line 1\u001b[0m\n\u001b[1;32m----> 1\u001b[0m reader \u001b[38;5;241m=\u001b[39m \u001b[43mcsv\u001b[49m\u001b[38;5;241;43m.\u001b[39;49m\u001b[43mreader\u001b[49m\u001b[43m(\u001b[49m\u001b[43mf\u001b[49m\u001b[43m,\u001b[49m\u001b[43m \u001b[49m\u001b[43mdialect\u001b[49m\u001b[38;5;241;43m=\u001b[39;49m\u001b[43mmy_dialect\u001b[49m\u001b[43m)\u001b[49m\n",
      "\u001b[1;31mValueError\u001b[0m: I/O operation on closed file."
     ]
    }
   ],
   "source": [
    "reader = csv.reader(f, dialect=my_dialect)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 16,
   "id": "5ce1a938",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "<_io.TextIOWrapper name='examples/ex7.csv' mode='r' encoding='cp936'>"
      ]
     },
     "execution_count": 16,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "f"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 17,
   "id": "6b525434",
   "metadata": {},
   "outputs": [],
   "source": [
    "with open('examples/ex7.csv') as f:\n",
    "    lines = list(csv.reader(f))"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 18,
   "id": "485be437",
   "metadata": {},
   "outputs": [
    {
     "ename": "ValueError",
     "evalue": "I/O operation on closed file.",
     "output_type": "error",
     "traceback": [
      "\u001b[1;31m---------------------------------------------------------------------------\u001b[0m",
      "\u001b[1;31mValueError\u001b[0m                                Traceback (most recent call last)",
      "Cell \u001b[1;32mIn[18], line 1\u001b[0m\n\u001b[1;32m----> 1\u001b[0m reader \u001b[38;5;241m=\u001b[39m \u001b[43mcsv\u001b[49m\u001b[38;5;241;43m.\u001b[39;49m\u001b[43mreader\u001b[49m\u001b[43m(\u001b[49m\u001b[43mf\u001b[49m\u001b[43m,\u001b[49m\u001b[43m \u001b[49m\u001b[43mdialect\u001b[49m\u001b[38;5;241;43m=\u001b[39;49m\u001b[43mmy_dialect\u001b[49m\u001b[43m)\u001b[49m\n",
      "\u001b[1;31mValueError\u001b[0m: I/O operation on closed file."
     ]
    }
   ],
   "source": [
    "reader = csv.reader(f, dialect=my_dialect)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 19,
   "id": "1bc6a079",
   "metadata": {},
   "outputs": [
    {
     "ename": "TypeError",
     "evalue": "\"quotechar\" must be a 1-character string",
     "output_type": "error",
     "traceback": [
      "\u001b[1;31m---------------------------------------------------------------------------\u001b[0m",
      "\u001b[1;31mTypeError\u001b[0m                                 Traceback (most recent call last)",
      "Cell \u001b[1;32mIn[19], line 2\u001b[0m\n\u001b[0;32m      1\u001b[0m \u001b[38;5;28;01mwith\u001b[39;00m \u001b[38;5;28mopen\u001b[39m(\u001b[38;5;124m'\u001b[39m\u001b[38;5;124mexamples/ex7.csv\u001b[39m\u001b[38;5;124m'\u001b[39m) \u001b[38;5;28;01mas\u001b[39;00m f:\n\u001b[1;32m----> 2\u001b[0m     reader \u001b[38;5;241m=\u001b[39m \u001b[43mcsv\u001b[49m\u001b[38;5;241;43m.\u001b[39;49m\u001b[43mreader\u001b[49m\u001b[43m(\u001b[49m\u001b[43mf\u001b[49m\u001b[43m,\u001b[49m\u001b[43m \u001b[49m\u001b[43mdialect\u001b[49m\u001b[38;5;241;43m=\u001b[39;49m\u001b[43mmy_dialect\u001b[49m\u001b[43m)\u001b[49m\n",
      "\u001b[1;31mTypeError\u001b[0m: \"quotechar\" must be a 1-character string"
     ]
    }
   ],
   "source": [
    "with open('examples/ex7.csv') as f:\n",
    "    reader = csv.reader(f, dialect=my_dialect)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 20,
   "id": "046ffe9f",
   "metadata": {},
   "outputs": [
    {
     "ename": "ValueError",
     "evalue": "I/O operation on closed file.",
     "output_type": "error",
     "traceback": [
      "\u001b[1;31m---------------------------------------------------------------------------\u001b[0m",
      "\u001b[1;31mValueError\u001b[0m                                Traceback (most recent call last)",
      "Cell \u001b[1;32mIn[20], line 1\u001b[0m\n\u001b[1;32m----> 1\u001b[0m reader\u001b[38;5;241m=\u001b[39m\u001b[43mcsv\u001b[49m\u001b[38;5;241;43m.\u001b[39;49m\u001b[43mreader\u001b[49m\u001b[43m(\u001b[49m\u001b[43mf\u001b[49m\u001b[43m,\u001b[49m\u001b[43m \u001b[49m\u001b[43mdelimiter\u001b[49m\u001b[38;5;241;43m=\u001b[39;49m\u001b[38;5;124;43m'\u001b[39;49m\u001b[38;5;124;43m|\u001b[39;49m\u001b[38;5;124;43m'\u001b[39;49m\u001b[43m)\u001b[49m\n",
      "\u001b[1;31mValueError\u001b[0m: I/O operation on closed file."
     ]
    }
   ],
   "source": [
    "reader=csv.reader(f, delimiter='|')"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 21,
   "id": "97df4407",
   "metadata": {},
   "outputs": [
    {
     "ename": "TypeError",
     "evalue": "\"quotechar\" must be a 1-character string",
     "output_type": "error",
     "traceback": [
      "\u001b[1;31m---------------------------------------------------------------------------\u001b[0m",
      "\u001b[1;31mTypeError\u001b[0m                                 Traceback (most recent call last)",
      "Cell \u001b[1;32mIn[21], line 2\u001b[0m\n\u001b[0;32m      1\u001b[0m \u001b[38;5;28;01mwith\u001b[39;00m \u001b[38;5;28mopen\u001b[39m(\u001b[38;5;124m'\u001b[39m\u001b[38;5;124mmydata.csv\u001b[39m\u001b[38;5;124m'\u001b[39m, \u001b[38;5;124m'\u001b[39m\u001b[38;5;124mw\u001b[39m\u001b[38;5;124m'\u001b[39m) \u001b[38;5;28;01mas\u001b[39;00m f:\n\u001b[1;32m----> 2\u001b[0m  writer \u001b[38;5;241m=\u001b[39m \u001b[43mcsv\u001b[49m\u001b[38;5;241;43m.\u001b[39;49m\u001b[43mwriter\u001b[49m\u001b[43m(\u001b[49m\u001b[43mf\u001b[49m\u001b[43m,\u001b[49m\u001b[43m \u001b[49m\u001b[43mdialect\u001b[49m\u001b[38;5;241;43m=\u001b[39;49m\u001b[43mmy_dialect\u001b[49m\u001b[43m)\u001b[49m\n\u001b[0;32m      3\u001b[0m  writer\u001b[38;5;241m.\u001b[39mwriterow((\u001b[38;5;124m'\u001b[39m\u001b[38;5;124mone\u001b[39m\u001b[38;5;124m'\u001b[39m, \u001b[38;5;124m'\u001b[39m\u001b[38;5;124mtwo\u001b[39m\u001b[38;5;124m'\u001b[39m, \u001b[38;5;124m'\u001b[39m\u001b[38;5;124mthree\u001b[39m\u001b[38;5;124m'\u001b[39m))\n\u001b[0;32m      4\u001b[0m  writer\u001b[38;5;241m.\u001b[39mwriterow((\u001b[38;5;124m'\u001b[39m\u001b[38;5;124m1\u001b[39m\u001b[38;5;124m'\u001b[39m, \u001b[38;5;124m'\u001b[39m\u001b[38;5;124m2\u001b[39m\u001b[38;5;124m'\u001b[39m, \u001b[38;5;124m'\u001b[39m\u001b[38;5;124m3\u001b[39m\u001b[38;5;124m'\u001b[39m))\n",
      "\u001b[1;31mTypeError\u001b[0m: \"quotechar\" must be a 1-character string"
     ]
    }
   ],
   "source": [
    "with open('mydata.csv', 'w') as f:\n",
    " writer = csv.writer(f, dialect=my_dialect)\n",
    " writer.writerow(('one', 'two', 'three'))\n",
    " writer.writerow(('1', '2', '3'))\n",
    " writer.writerow(('4', '5', '6'))\n",
    " writer.writerow(('7', '8', '9'))"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 22,
   "id": "981b1871",
   "metadata": {},
   "outputs": [],
   "source": [
    "class my_dialect(csv.Dialect):\n",
    " lineterminator = '\\n'\n",
    " delimiter = ';'\n",
    " quotechar = '\"'\n",
    " quoting = csv.QUOTE_MINIMAL"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 23,
   "id": "4e4b5fb2",
   "metadata": {},
   "outputs": [],
   "source": [
    "with open('mydata.csv', 'w') as f:\n",
    " writer = csv.writer(f, dialect=my_dialect)\n",
    " writer.writerow(('one', 'two', 'three'))\n",
    " writer.writerow(('1', '2', '3'))\n",
    " writer.writerow(('4', '5', '6'))\n",
    " writer.writerow(('7', '8', '9'))"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 24,
   "id": "8e817de8",
   "metadata": {},
   "outputs": [],
   "source": [
    "obj = \"\"\"\n",
    "{\"name\": \"Wes\",\n",
    " \"cities_lived\": [\"Akron\", \"Nashville\", \"New York\", \"San\n",
    "Francisco\"],\n",
    " \"pet\": null,\n",
    " \"siblings\": [{\"name\": \"Scott\", \"age\": 34, \"hobbies\": [\"guitars\",\n",
    "\"soccer\"]},\n",
    " {\"name\": \"Katie\", \"age\": 42, \"hobbies\": [\"diving\",\n",
    "\"art\"]}]\n",
    "}\n",
    "\"\"\""
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 25,
   "id": "e019ea9c",
   "metadata": {},
   "outputs": [],
   "source": [
    "import json"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 26,
   "id": "48a28edf",
   "metadata": {},
   "outputs": [
    {
     "ename": "JSONDecodeError",
     "evalue": "Invalid control character at: line 3 column 57 (char 73)",
     "output_type": "error",
     "traceback": [
      "\u001b[1;31m---------------------------------------------------------------------------\u001b[0m",
      "\u001b[1;31mJSONDecodeError\u001b[0m                           Traceback (most recent call last)",
      "Cell \u001b[1;32mIn[26], line 1\u001b[0m\n\u001b[1;32m----> 1\u001b[0m result \u001b[38;5;241m=\u001b[39m \u001b[43mjson\u001b[49m\u001b[38;5;241;43m.\u001b[39;49m\u001b[43mloads\u001b[49m\u001b[43m(\u001b[49m\u001b[43mobj\u001b[49m\u001b[43m)\u001b[49m\n",
      "File \u001b[1;32mD:\\miniconda3\\envs\\pydata-book\\lib\\json\\__init__.py:357\u001b[0m, in \u001b[0;36mloads\u001b[1;34m(s, cls, object_hook, parse_float, parse_int, parse_constant, object_pairs_hook, **kw)\u001b[0m\n\u001b[0;32m    352\u001b[0m     \u001b[38;5;28;01mdel\u001b[39;00m kw[\u001b[38;5;124m'\u001b[39m\u001b[38;5;124mencoding\u001b[39m\u001b[38;5;124m'\u001b[39m]\n\u001b[0;32m    354\u001b[0m \u001b[38;5;28;01mif\u001b[39;00m (\u001b[38;5;28mcls\u001b[39m \u001b[38;5;129;01mis\u001b[39;00m \u001b[38;5;28;01mNone\u001b[39;00m \u001b[38;5;129;01mand\u001b[39;00m object_hook \u001b[38;5;129;01mis\u001b[39;00m \u001b[38;5;28;01mNone\u001b[39;00m \u001b[38;5;129;01mand\u001b[39;00m\n\u001b[0;32m    355\u001b[0m         parse_int \u001b[38;5;129;01mis\u001b[39;00m \u001b[38;5;28;01mNone\u001b[39;00m \u001b[38;5;129;01mand\u001b[39;00m parse_float \u001b[38;5;129;01mis\u001b[39;00m \u001b[38;5;28;01mNone\u001b[39;00m \u001b[38;5;129;01mand\u001b[39;00m\n\u001b[0;32m    356\u001b[0m         parse_constant \u001b[38;5;129;01mis\u001b[39;00m \u001b[38;5;28;01mNone\u001b[39;00m \u001b[38;5;129;01mand\u001b[39;00m object_pairs_hook \u001b[38;5;129;01mis\u001b[39;00m \u001b[38;5;28;01mNone\u001b[39;00m \u001b[38;5;129;01mand\u001b[39;00m \u001b[38;5;129;01mnot\u001b[39;00m kw):\n\u001b[1;32m--> 357\u001b[0m     \u001b[38;5;28;01mreturn\u001b[39;00m \u001b[43m_default_decoder\u001b[49m\u001b[38;5;241;43m.\u001b[39;49m\u001b[43mdecode\u001b[49m\u001b[43m(\u001b[49m\u001b[43ms\u001b[49m\u001b[43m)\u001b[49m\n\u001b[0;32m    358\u001b[0m \u001b[38;5;28;01mif\u001b[39;00m \u001b[38;5;28mcls\u001b[39m \u001b[38;5;129;01mis\u001b[39;00m \u001b[38;5;28;01mNone\u001b[39;00m:\n\u001b[0;32m    359\u001b[0m     \u001b[38;5;28mcls\u001b[39m \u001b[38;5;241m=\u001b[39m JSONDecoder\n",
      "File \u001b[1;32mD:\\miniconda3\\envs\\pydata-book\\lib\\json\\decoder.py:337\u001b[0m, in \u001b[0;36mJSONDecoder.decode\u001b[1;34m(self, s, _w)\u001b[0m\n\u001b[0;32m    332\u001b[0m \u001b[38;5;28;01mdef\u001b[39;00m \u001b[38;5;21mdecode\u001b[39m(\u001b[38;5;28mself\u001b[39m, s, _w\u001b[38;5;241m=\u001b[39mWHITESPACE\u001b[38;5;241m.\u001b[39mmatch):\n\u001b[0;32m    333\u001b[0m \u001b[38;5;250m    \u001b[39m\u001b[38;5;124;03m\"\"\"Return the Python representation of ``s`` (a ``str`` instance\u001b[39;00m\n\u001b[0;32m    334\u001b[0m \u001b[38;5;124;03m    containing a JSON document).\u001b[39;00m\n\u001b[0;32m    335\u001b[0m \n\u001b[0;32m    336\u001b[0m \u001b[38;5;124;03m    \"\"\"\u001b[39;00m\n\u001b[1;32m--> 337\u001b[0m     obj, end \u001b[38;5;241m=\u001b[39m \u001b[38;5;28;43mself\u001b[39;49m\u001b[38;5;241;43m.\u001b[39;49m\u001b[43mraw_decode\u001b[49m\u001b[43m(\u001b[49m\u001b[43ms\u001b[49m\u001b[43m,\u001b[49m\u001b[43m \u001b[49m\u001b[43midx\u001b[49m\u001b[38;5;241;43m=\u001b[39;49m\u001b[43m_w\u001b[49m\u001b[43m(\u001b[49m\u001b[43ms\u001b[49m\u001b[43m,\u001b[49m\u001b[43m \u001b[49m\u001b[38;5;241;43m0\u001b[39;49m\u001b[43m)\u001b[49m\u001b[38;5;241;43m.\u001b[39;49m\u001b[43mend\u001b[49m\u001b[43m(\u001b[49m\u001b[43m)\u001b[49m\u001b[43m)\u001b[49m\n\u001b[0;32m    338\u001b[0m     end \u001b[38;5;241m=\u001b[39m _w(s, end)\u001b[38;5;241m.\u001b[39mend()\n\u001b[0;32m    339\u001b[0m     \u001b[38;5;28;01mif\u001b[39;00m end \u001b[38;5;241m!=\u001b[39m \u001b[38;5;28mlen\u001b[39m(s):\n",
      "File \u001b[1;32mD:\\miniconda3\\envs\\pydata-book\\lib\\json\\decoder.py:353\u001b[0m, in \u001b[0;36mJSONDecoder.raw_decode\u001b[1;34m(self, s, idx)\u001b[0m\n\u001b[0;32m    344\u001b[0m \u001b[38;5;250m\u001b[39m\u001b[38;5;124;03m\"\"\"Decode a JSON document from ``s`` (a ``str`` beginning with\u001b[39;00m\n\u001b[0;32m    345\u001b[0m \u001b[38;5;124;03ma JSON document) and return a 2-tuple of the Python\u001b[39;00m\n\u001b[0;32m    346\u001b[0m \u001b[38;5;124;03mrepresentation and the index in ``s`` where the document ended.\u001b[39;00m\n\u001b[1;32m   (...)\u001b[0m\n\u001b[0;32m    350\u001b[0m \n\u001b[0;32m    351\u001b[0m \u001b[38;5;124;03m\"\"\"\u001b[39;00m\n\u001b[0;32m    352\u001b[0m \u001b[38;5;28;01mtry\u001b[39;00m:\n\u001b[1;32m--> 353\u001b[0m     obj, end \u001b[38;5;241m=\u001b[39m \u001b[38;5;28;43mself\u001b[39;49m\u001b[38;5;241;43m.\u001b[39;49m\u001b[43mscan_once\u001b[49m\u001b[43m(\u001b[49m\u001b[43ms\u001b[49m\u001b[43m,\u001b[49m\u001b[43m \u001b[49m\u001b[43midx\u001b[49m\u001b[43m)\u001b[49m\n\u001b[0;32m    354\u001b[0m \u001b[38;5;28;01mexcept\u001b[39;00m \u001b[38;5;167;01mStopIteration\u001b[39;00m \u001b[38;5;28;01mas\u001b[39;00m err:\n\u001b[0;32m    355\u001b[0m     \u001b[38;5;28;01mraise\u001b[39;00m JSONDecodeError(\u001b[38;5;124m\"\u001b[39m\u001b[38;5;124mExpecting value\u001b[39m\u001b[38;5;124m\"\u001b[39m, s, err\u001b[38;5;241m.\u001b[39mvalue) \u001b[38;5;28;01mfrom\u001b[39;00m \u001b[38;5;28;01mNone\u001b[39;00m\n",
      "\u001b[1;31mJSONDecodeError\u001b[0m: Invalid control character at: line 3 column 57 (char 73)"
     ]
    }
   ],
   "source": [
    "result = json.loads(obj)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 27,
   "id": "e1668dc0",
   "metadata": {},
   "outputs": [],
   "source": [
    "obj = \"\"\"\n",
    "{\"name\": \"Wes\",\n",
    " \"cities_lived\": [\"Akron\", \"Nashville\", \"New York\", \"San\n",
    "Francisco\"],\n",
    " \"pet\": null,\n",
    " \"siblings\": [{\"name\": \"Scott\", \"age\": 34, \"hobbies\": [\"guitars\",\n",
    "\"soccer\"]},\n",
    " {\"name\": \"Katie\", \"age\": 42, \"hobbies\": [\"diving\",\n",
    "\"art\"]}]\n",
    "}\n",
    "\"\"\""
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 28,
   "id": "4847068d",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "'\\n{\"name\": \"Wes\",\\n \"cities_lived\": [\"Akron\", \"Nashville\", \"New York\", \"San\\nFrancisco\"],\\n \"pet\": null,\\n \"siblings\": [{\"name\": \"Scott\", \"age\": 34, \"hobbies\": [\"guitars\",\\n\"soccer\"]},\\n {\"name\": \"Katie\", \"age\": 42, \"hobbies\": [\"diving\",\\n\"art\"]}]\\n}\\n'"
      ]
     },
     "execution_count": 28,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "obj"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 29,
   "id": "db483f8f",
   "metadata": {},
   "outputs": [
    {
     "ename": "JSONDecodeError",
     "evalue": "Invalid control character at: line 3 column 57 (char 73)",
     "output_type": "error",
     "traceback": [
      "\u001b[1;31m---------------------------------------------------------------------------\u001b[0m",
      "\u001b[1;31mJSONDecodeError\u001b[0m                           Traceback (most recent call last)",
      "Cell \u001b[1;32mIn[29], line 1\u001b[0m\n\u001b[1;32m----> 1\u001b[0m result \u001b[38;5;241m=\u001b[39m \u001b[43mjson\u001b[49m\u001b[38;5;241;43m.\u001b[39;49m\u001b[43mloads\u001b[49m\u001b[43m(\u001b[49m\u001b[43mobj\u001b[49m\u001b[43m)\u001b[49m\n",
      "File \u001b[1;32mD:\\miniconda3\\envs\\pydata-book\\lib\\json\\__init__.py:357\u001b[0m, in \u001b[0;36mloads\u001b[1;34m(s, cls, object_hook, parse_float, parse_int, parse_constant, object_pairs_hook, **kw)\u001b[0m\n\u001b[0;32m    352\u001b[0m     \u001b[38;5;28;01mdel\u001b[39;00m kw[\u001b[38;5;124m'\u001b[39m\u001b[38;5;124mencoding\u001b[39m\u001b[38;5;124m'\u001b[39m]\n\u001b[0;32m    354\u001b[0m \u001b[38;5;28;01mif\u001b[39;00m (\u001b[38;5;28mcls\u001b[39m \u001b[38;5;129;01mis\u001b[39;00m \u001b[38;5;28;01mNone\u001b[39;00m \u001b[38;5;129;01mand\u001b[39;00m object_hook \u001b[38;5;129;01mis\u001b[39;00m \u001b[38;5;28;01mNone\u001b[39;00m \u001b[38;5;129;01mand\u001b[39;00m\n\u001b[0;32m    355\u001b[0m         parse_int \u001b[38;5;129;01mis\u001b[39;00m \u001b[38;5;28;01mNone\u001b[39;00m \u001b[38;5;129;01mand\u001b[39;00m parse_float \u001b[38;5;129;01mis\u001b[39;00m \u001b[38;5;28;01mNone\u001b[39;00m \u001b[38;5;129;01mand\u001b[39;00m\n\u001b[0;32m    356\u001b[0m         parse_constant \u001b[38;5;129;01mis\u001b[39;00m \u001b[38;5;28;01mNone\u001b[39;00m \u001b[38;5;129;01mand\u001b[39;00m object_pairs_hook \u001b[38;5;129;01mis\u001b[39;00m \u001b[38;5;28;01mNone\u001b[39;00m \u001b[38;5;129;01mand\u001b[39;00m \u001b[38;5;129;01mnot\u001b[39;00m kw):\n\u001b[1;32m--> 357\u001b[0m     \u001b[38;5;28;01mreturn\u001b[39;00m \u001b[43m_default_decoder\u001b[49m\u001b[38;5;241;43m.\u001b[39;49m\u001b[43mdecode\u001b[49m\u001b[43m(\u001b[49m\u001b[43ms\u001b[49m\u001b[43m)\u001b[49m\n\u001b[0;32m    358\u001b[0m \u001b[38;5;28;01mif\u001b[39;00m \u001b[38;5;28mcls\u001b[39m \u001b[38;5;129;01mis\u001b[39;00m \u001b[38;5;28;01mNone\u001b[39;00m:\n\u001b[0;32m    359\u001b[0m     \u001b[38;5;28mcls\u001b[39m \u001b[38;5;241m=\u001b[39m JSONDecoder\n",
      "File \u001b[1;32mD:\\miniconda3\\envs\\pydata-book\\lib\\json\\decoder.py:337\u001b[0m, in \u001b[0;36mJSONDecoder.decode\u001b[1;34m(self, s, _w)\u001b[0m\n\u001b[0;32m    332\u001b[0m \u001b[38;5;28;01mdef\u001b[39;00m \u001b[38;5;21mdecode\u001b[39m(\u001b[38;5;28mself\u001b[39m, s, _w\u001b[38;5;241m=\u001b[39mWHITESPACE\u001b[38;5;241m.\u001b[39mmatch):\n\u001b[0;32m    333\u001b[0m \u001b[38;5;250m    \u001b[39m\u001b[38;5;124;03m\"\"\"Return the Python representation of ``s`` (a ``str`` instance\u001b[39;00m\n\u001b[0;32m    334\u001b[0m \u001b[38;5;124;03m    containing a JSON document).\u001b[39;00m\n\u001b[0;32m    335\u001b[0m \n\u001b[0;32m    336\u001b[0m \u001b[38;5;124;03m    \"\"\"\u001b[39;00m\n\u001b[1;32m--> 337\u001b[0m     obj, end \u001b[38;5;241m=\u001b[39m \u001b[38;5;28;43mself\u001b[39;49m\u001b[38;5;241;43m.\u001b[39;49m\u001b[43mraw_decode\u001b[49m\u001b[43m(\u001b[49m\u001b[43ms\u001b[49m\u001b[43m,\u001b[49m\u001b[43m \u001b[49m\u001b[43midx\u001b[49m\u001b[38;5;241;43m=\u001b[39;49m\u001b[43m_w\u001b[49m\u001b[43m(\u001b[49m\u001b[43ms\u001b[49m\u001b[43m,\u001b[49m\u001b[43m \u001b[49m\u001b[38;5;241;43m0\u001b[39;49m\u001b[43m)\u001b[49m\u001b[38;5;241;43m.\u001b[39;49m\u001b[43mend\u001b[49m\u001b[43m(\u001b[49m\u001b[43m)\u001b[49m\u001b[43m)\u001b[49m\n\u001b[0;32m    338\u001b[0m     end \u001b[38;5;241m=\u001b[39m _w(s, end)\u001b[38;5;241m.\u001b[39mend()\n\u001b[0;32m    339\u001b[0m     \u001b[38;5;28;01mif\u001b[39;00m end \u001b[38;5;241m!=\u001b[39m \u001b[38;5;28mlen\u001b[39m(s):\n",
      "File \u001b[1;32mD:\\miniconda3\\envs\\pydata-book\\lib\\json\\decoder.py:353\u001b[0m, in \u001b[0;36mJSONDecoder.raw_decode\u001b[1;34m(self, s, idx)\u001b[0m\n\u001b[0;32m    344\u001b[0m \u001b[38;5;250m\u001b[39m\u001b[38;5;124;03m\"\"\"Decode a JSON document from ``s`` (a ``str`` beginning with\u001b[39;00m\n\u001b[0;32m    345\u001b[0m \u001b[38;5;124;03ma JSON document) and return a 2-tuple of the Python\u001b[39;00m\n\u001b[0;32m    346\u001b[0m \u001b[38;5;124;03mrepresentation and the index in ``s`` where the document ended.\u001b[39;00m\n\u001b[1;32m   (...)\u001b[0m\n\u001b[0;32m    350\u001b[0m \n\u001b[0;32m    351\u001b[0m \u001b[38;5;124;03m\"\"\"\u001b[39;00m\n\u001b[0;32m    352\u001b[0m \u001b[38;5;28;01mtry\u001b[39;00m:\n\u001b[1;32m--> 353\u001b[0m     obj, end \u001b[38;5;241m=\u001b[39m \u001b[38;5;28;43mself\u001b[39;49m\u001b[38;5;241;43m.\u001b[39;49m\u001b[43mscan_once\u001b[49m\u001b[43m(\u001b[49m\u001b[43ms\u001b[49m\u001b[43m,\u001b[49m\u001b[43m \u001b[49m\u001b[43midx\u001b[49m\u001b[43m)\u001b[49m\n\u001b[0;32m    354\u001b[0m \u001b[38;5;28;01mexcept\u001b[39;00m \u001b[38;5;167;01mStopIteration\u001b[39;00m \u001b[38;5;28;01mas\u001b[39;00m err:\n\u001b[0;32m    355\u001b[0m     \u001b[38;5;28;01mraise\u001b[39;00m JSONDecodeError(\u001b[38;5;124m\"\u001b[39m\u001b[38;5;124mExpecting value\u001b[39m\u001b[38;5;124m\"\u001b[39m, s, err\u001b[38;5;241m.\u001b[39mvalue) \u001b[38;5;28;01mfrom\u001b[39;00m \u001b[38;5;28;01mNone\u001b[39;00m\n",
      "\u001b[1;31mJSONDecodeError\u001b[0m: Invalid control character at: line 3 column 57 (char 73)"
     ]
    }
   ],
   "source": [
    "result = json.loads(obj)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 30,
   "id": "b26712ac",
   "metadata": {},
   "outputs": [],
   "source": [
    "obj = \"\"\"\n",
    "{\"name\": \"Wes\",\n",
    " \"cities_lived\": [\"Akron\", \"Nashville\", \"New York\", \"San\n",
    "Francisco\"],\n",
    " \"pet\": null,\n",
    " \"siblings\": [{\"name\": \"Scott\", \"age\": 34, \"hobbies\": [\"guitars\",\n",
    "\"soccer\"]},\n",
    " {\"name\": \"Katie\", \"age\": 42, \"hobbies\": [\"diving\",\n",
    "\"art\"]}]\n",
    "}\n",
    "\"\"\""
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 31,
   "id": "1e26291c",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "'\\n{\"name\": \"Wes\",\\n \"cities_lived\": [\"Akron\", \"Nashville\", \"New York\", \"San\\nFrancisco\"],\\n \"pet\": null,\\n \"siblings\": [{\"name\": \"Scott\", \"age\": 34, \"hobbies\": [\"guitars\",\\n\"soccer\"]},\\n {\"name\": \"Katie\", \"age\": 42, \"hobbies\": [\"diving\",\\n\"art\"]}]\\n}\\n'"
      ]
     },
     "execution_count": 31,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "obj"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 32,
   "id": "abf6214c",
   "metadata": {},
   "outputs": [
    {
     "ename": "JSONDecodeError",
     "evalue": "Invalid control character at: line 3 column 57 (char 73)",
     "output_type": "error",
     "traceback": [
      "\u001b[1;31m---------------------------------------------------------------------------\u001b[0m",
      "\u001b[1;31mJSONDecodeError\u001b[0m                           Traceback (most recent call last)",
      "Cell \u001b[1;32mIn[32], line 1\u001b[0m\n\u001b[1;32m----> 1\u001b[0m \u001b[43mjson\u001b[49m\u001b[38;5;241;43m.\u001b[39;49m\u001b[43mloads\u001b[49m\u001b[43m(\u001b[49m\u001b[43mobj\u001b[49m\u001b[43m)\u001b[49m\n",
      "File \u001b[1;32mD:\\miniconda3\\envs\\pydata-book\\lib\\json\\__init__.py:357\u001b[0m, in \u001b[0;36mloads\u001b[1;34m(s, cls, object_hook, parse_float, parse_int, parse_constant, object_pairs_hook, **kw)\u001b[0m\n\u001b[0;32m    352\u001b[0m     \u001b[38;5;28;01mdel\u001b[39;00m kw[\u001b[38;5;124m'\u001b[39m\u001b[38;5;124mencoding\u001b[39m\u001b[38;5;124m'\u001b[39m]\n\u001b[0;32m    354\u001b[0m \u001b[38;5;28;01mif\u001b[39;00m (\u001b[38;5;28mcls\u001b[39m \u001b[38;5;129;01mis\u001b[39;00m \u001b[38;5;28;01mNone\u001b[39;00m \u001b[38;5;129;01mand\u001b[39;00m object_hook \u001b[38;5;129;01mis\u001b[39;00m \u001b[38;5;28;01mNone\u001b[39;00m \u001b[38;5;129;01mand\u001b[39;00m\n\u001b[0;32m    355\u001b[0m         parse_int \u001b[38;5;129;01mis\u001b[39;00m \u001b[38;5;28;01mNone\u001b[39;00m \u001b[38;5;129;01mand\u001b[39;00m parse_float \u001b[38;5;129;01mis\u001b[39;00m \u001b[38;5;28;01mNone\u001b[39;00m \u001b[38;5;129;01mand\u001b[39;00m\n\u001b[0;32m    356\u001b[0m         parse_constant \u001b[38;5;129;01mis\u001b[39;00m \u001b[38;5;28;01mNone\u001b[39;00m \u001b[38;5;129;01mand\u001b[39;00m object_pairs_hook \u001b[38;5;129;01mis\u001b[39;00m \u001b[38;5;28;01mNone\u001b[39;00m \u001b[38;5;129;01mand\u001b[39;00m \u001b[38;5;129;01mnot\u001b[39;00m kw):\n\u001b[1;32m--> 357\u001b[0m     \u001b[38;5;28;01mreturn\u001b[39;00m \u001b[43m_default_decoder\u001b[49m\u001b[38;5;241;43m.\u001b[39;49m\u001b[43mdecode\u001b[49m\u001b[43m(\u001b[49m\u001b[43ms\u001b[49m\u001b[43m)\u001b[49m\n\u001b[0;32m    358\u001b[0m \u001b[38;5;28;01mif\u001b[39;00m \u001b[38;5;28mcls\u001b[39m \u001b[38;5;129;01mis\u001b[39;00m \u001b[38;5;28;01mNone\u001b[39;00m:\n\u001b[0;32m    359\u001b[0m     \u001b[38;5;28mcls\u001b[39m \u001b[38;5;241m=\u001b[39m JSONDecoder\n",
      "File \u001b[1;32mD:\\miniconda3\\envs\\pydata-book\\lib\\json\\decoder.py:337\u001b[0m, in \u001b[0;36mJSONDecoder.decode\u001b[1;34m(self, s, _w)\u001b[0m\n\u001b[0;32m    332\u001b[0m \u001b[38;5;28;01mdef\u001b[39;00m \u001b[38;5;21mdecode\u001b[39m(\u001b[38;5;28mself\u001b[39m, s, _w\u001b[38;5;241m=\u001b[39mWHITESPACE\u001b[38;5;241m.\u001b[39mmatch):\n\u001b[0;32m    333\u001b[0m \u001b[38;5;250m    \u001b[39m\u001b[38;5;124;03m\"\"\"Return the Python representation of ``s`` (a ``str`` instance\u001b[39;00m\n\u001b[0;32m    334\u001b[0m \u001b[38;5;124;03m    containing a JSON document).\u001b[39;00m\n\u001b[0;32m    335\u001b[0m \n\u001b[0;32m    336\u001b[0m \u001b[38;5;124;03m    \"\"\"\u001b[39;00m\n\u001b[1;32m--> 337\u001b[0m     obj, end \u001b[38;5;241m=\u001b[39m \u001b[38;5;28;43mself\u001b[39;49m\u001b[38;5;241;43m.\u001b[39;49m\u001b[43mraw_decode\u001b[49m\u001b[43m(\u001b[49m\u001b[43ms\u001b[49m\u001b[43m,\u001b[49m\u001b[43m \u001b[49m\u001b[43midx\u001b[49m\u001b[38;5;241;43m=\u001b[39;49m\u001b[43m_w\u001b[49m\u001b[43m(\u001b[49m\u001b[43ms\u001b[49m\u001b[43m,\u001b[49m\u001b[43m \u001b[49m\u001b[38;5;241;43m0\u001b[39;49m\u001b[43m)\u001b[49m\u001b[38;5;241;43m.\u001b[39;49m\u001b[43mend\u001b[49m\u001b[43m(\u001b[49m\u001b[43m)\u001b[49m\u001b[43m)\u001b[49m\n\u001b[0;32m    338\u001b[0m     end \u001b[38;5;241m=\u001b[39m _w(s, end)\u001b[38;5;241m.\u001b[39mend()\n\u001b[0;32m    339\u001b[0m     \u001b[38;5;28;01mif\u001b[39;00m end \u001b[38;5;241m!=\u001b[39m \u001b[38;5;28mlen\u001b[39m(s):\n",
      "File \u001b[1;32mD:\\miniconda3\\envs\\pydata-book\\lib\\json\\decoder.py:353\u001b[0m, in \u001b[0;36mJSONDecoder.raw_decode\u001b[1;34m(self, s, idx)\u001b[0m\n\u001b[0;32m    344\u001b[0m \u001b[38;5;250m\u001b[39m\u001b[38;5;124;03m\"\"\"Decode a JSON document from ``s`` (a ``str`` beginning with\u001b[39;00m\n\u001b[0;32m    345\u001b[0m \u001b[38;5;124;03ma JSON document) and return a 2-tuple of the Python\u001b[39;00m\n\u001b[0;32m    346\u001b[0m \u001b[38;5;124;03mrepresentation and the index in ``s`` where the document ended.\u001b[39;00m\n\u001b[1;32m   (...)\u001b[0m\n\u001b[0;32m    350\u001b[0m \n\u001b[0;32m    351\u001b[0m \u001b[38;5;124;03m\"\"\"\u001b[39;00m\n\u001b[0;32m    352\u001b[0m \u001b[38;5;28;01mtry\u001b[39;00m:\n\u001b[1;32m--> 353\u001b[0m     obj, end \u001b[38;5;241m=\u001b[39m \u001b[38;5;28;43mself\u001b[39;49m\u001b[38;5;241;43m.\u001b[39;49m\u001b[43mscan_once\u001b[49m\u001b[43m(\u001b[49m\u001b[43ms\u001b[49m\u001b[43m,\u001b[49m\u001b[43m \u001b[49m\u001b[43midx\u001b[49m\u001b[43m)\u001b[49m\n\u001b[0;32m    354\u001b[0m \u001b[38;5;28;01mexcept\u001b[39;00m \u001b[38;5;167;01mStopIteration\u001b[39;00m \u001b[38;5;28;01mas\u001b[39;00m err:\n\u001b[0;32m    355\u001b[0m     \u001b[38;5;28;01mraise\u001b[39;00m JSONDecodeError(\u001b[38;5;124m\"\u001b[39m\u001b[38;5;124mExpecting value\u001b[39m\u001b[38;5;124m\"\u001b[39m, s, err\u001b[38;5;241m.\u001b[39mvalue) \u001b[38;5;28;01mfrom\u001b[39;00m \u001b[38;5;28;01mNone\u001b[39;00m\n",
      "\u001b[1;31mJSONDecodeError\u001b[0m: Invalid control character at: line 3 column 57 (char 73)"
     ]
    }
   ],
   "source": [
    "json.loads(obj)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 33,
   "id": "9d02a37f",
   "metadata": {},
   "outputs": [],
   "source": [
    "obj = \"\"\"\n",
    "{\"name\": \"Wes\",\n",
    " \"cities_lived\": [\"Akron\", \"Nashville\", \"New York\", \"SanFrancisco\"],\n",
    " \"pet\": null,\n",
    " \"siblings\": [{\"name\": \"Scott\", \"age\": 34, \"hobbies\": [\"guitars\",\"soccer\"]},\n",
    " {\"name\": \"Katie\", \"age\": 42, \"hobbies\": [\"diving\",\"art\"]}]\n",
    "}\n",
    "\"\"\""
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 34,
   "id": "073e1c5f",
   "metadata": {},
   "outputs": [
    {
     "ename": "NameError",
     "evalue": "name 'objs' is not defined",
     "output_type": "error",
     "traceback": [
      "\u001b[1;31m---------------------------------------------------------------------------\u001b[0m",
      "\u001b[1;31mNameError\u001b[0m                                 Traceback (most recent call last)",
      "Cell \u001b[1;32mIn[34], line 1\u001b[0m\n\u001b[1;32m----> 1\u001b[0m result \u001b[38;5;241m=\u001b[39m json\u001b[38;5;241m.\u001b[39mloads(\u001b[43mobjs\u001b[49m)\n",
      "\u001b[1;31mNameError\u001b[0m: name 'objs' is not defined"
     ]
    }
   ],
   "source": [
    "result = json.loads(objs)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 35,
   "id": "3a2a0d07",
   "metadata": {},
   "outputs": [],
   "source": [
    "result = json.loads(obj)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 36,
   "id": "a6c590b6",
   "metadata": {},
   "outputs": [
    {
     "ename": "NameError",
     "evalue": "name 'resi' is not defined",
     "output_type": "error",
     "traceback": [
      "\u001b[1;31m---------------------------------------------------------------------------\u001b[0m",
      "\u001b[1;31mNameError\u001b[0m                                 Traceback (most recent call last)",
      "Cell \u001b[1;32mIn[36], line 1\u001b[0m\n\u001b[1;32m----> 1\u001b[0m \u001b[43mresi\u001b[49m;t\n",
      "\u001b[1;31mNameError\u001b[0m: name 'resi' is not defined"
     ]
    }
   ],
   "source": [
    "resi;t"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 37,
   "id": "5ab814e0",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "{'name': 'Wes',\n",
       " 'cities_lived': ['Akron', 'Nashville', 'New York', 'SanFrancisco'],\n",
       " 'pet': None,\n",
       " 'siblings': [{'name': 'Scott', 'age': 34, 'hobbies': ['guitars', 'soccer']},\n",
       "  {'name': 'Katie', 'age': 42, 'hobbies': ['diving', 'art']}]}"
      ]
     },
     "execution_count": 37,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "result"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 38,
   "id": "3c8e24cc",
   "metadata": {},
   "outputs": [],
   "source": [
    "asjson = json.dumps(result)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 39,
   "id": "f325af96",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "'{\"name\": \"Wes\", \"cities_lived\": [\"Akron\", \"Nashville\", \"New York\", \"SanFrancisco\"], \"pet\": null, \"siblings\": [{\"name\": \"Scott\", \"age\": 34, \"hobbies\": [\"guitars\", \"soccer\"]}, {\"name\": \"Katie\", \"age\": 42, \"hobbies\": [\"diving\", \"art\"]}]}'"
      ]
     },
     "execution_count": 39,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "asjson"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 40,
   "id": "a0d4938f",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "'\\n{\"name\": \"Wes\",\\n \"cities_lived\": [\"Akron\", \"Nashville\", \"New York\", \"SanFrancisco\"],\\n \"pet\": null,\\n \"siblings\": [{\"name\": \"Scott\", \"age\": 34, \"hobbies\": [\"guitars\",\"soccer\"]},\\n {\"name\": \"Katie\", \"age\": 42, \"hobbies\": [\"diving\",\"art\"]}]\\n}\\n'"
      ]
     },
     "execution_count": 40,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "obj"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 41,
   "id": "694149a2",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "{'name': 'Wes',\n",
       " 'cities_lived': ['Akron', 'Nashville', 'New York', 'SanFrancisco'],\n",
       " 'pet': None,\n",
       " 'siblings': [{'name': 'Scott', 'age': 34, 'hobbies': ['guitars', 'soccer']},\n",
       "  {'name': 'Katie', 'age': 42, 'hobbies': ['diving', 'art']}]}"
      ]
     },
     "execution_count": 41,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "result"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 42,
   "id": "1472cdac",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "dict"
      ]
     },
     "execution_count": 42,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "type(result)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 43,
   "id": "c66dae1a",
   "metadata": {},
   "outputs": [],
   "source": [
    "import pandas as pd"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 44,
   "id": "c71485af",
   "metadata": {},
   "outputs": [],
   "source": [
    "siblings = pd.DataFrame(result['siblings'], columns=['name','age'])"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 45,
   "id": "701f9eb7",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style scoped>\n",
       "    .dataframe tbody tr th:only-of-type {\n",
       "        vertical-align: middle;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: right;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>name</th>\n",
       "      <th>age</th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>0</th>\n",
       "      <td>Scott</td>\n",
       "      <td>34</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>1</th>\n",
       "      <td>Katie</td>\n",
       "      <td>42</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "</div>"
      ],
      "text/plain": [
       "    name  age\n",
       "0  Scott   34\n",
       "1  Katie   42"
      ]
     },
     "execution_count": 45,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "siblings"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 46,
   "id": "4c118446",
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "[{\"a\": 1, \"b\": 2, \"c\": 3},\n",
      " {\"a\": 4, \"b\": 5, \"c\": 6},\n",
      " {\"a\": 7, \"b\": 8, \"c\": 9}]\n"
     ]
    }
   ],
   "source": [
    "!type examples\\example.json"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 47,
   "id": "323c6135",
   "metadata": {},
   "outputs": [
    {
     "ename": "AttributeError",
     "evalue": "module 'pandas' has no attribute 'read'",
     "output_type": "error",
     "traceback": [
      "\u001b[1;31m---------------------------------------------------------------------------\u001b[0m",
      "\u001b[1;31mAttributeError\u001b[0m                            Traceback (most recent call last)",
      "Cell \u001b[1;32mIn[47], line 1\u001b[0m\n\u001b[1;32m----> 1\u001b[0m data \u001b[38;5;241m=\u001b[39m \u001b[43mpd\u001b[49m\u001b[38;5;241;43m.\u001b[39;49m\u001b[43mread\u001b[49m\u001b[38;5;241m.\u001b[39mjson(\u001b[38;5;124m'\u001b[39m\u001b[38;5;124mexamples/example.json\u001b[39m\u001b[38;5;124m'\u001b[39m)\n",
      "\u001b[1;31mAttributeError\u001b[0m: module 'pandas' has no attribute 'read'"
     ]
    }
   ],
   "source": [
    "data = pd.read.json('examples/example.json')"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 48,
   "id": "9c9a414d",
   "metadata": {},
   "outputs": [],
   "source": [
    "data = pd.read_json('examples/example.json')"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 49,
   "id": "4d7bd910",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style scoped>\n",
       "    .dataframe tbody tr th:only-of-type {\n",
       "        vertical-align: middle;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: right;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>a</th>\n",
       "      <th>b</th>\n",
       "      <th>c</th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>0</th>\n",
       "      <td>1</td>\n",
       "      <td>2</td>\n",
       "      <td>3</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>1</th>\n",
       "      <td>4</td>\n",
       "      <td>5</td>\n",
       "      <td>6</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2</th>\n",
       "      <td>7</td>\n",
       "      <td>8</td>\n",
       "      <td>9</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "</div>"
      ],
      "text/plain": [
       "   a  b  c\n",
       "0  1  2  3\n",
       "1  4  5  6\n",
       "2  7  8  9"
      ]
     },
     "execution_count": 49,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "data"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 50,
   "id": "bdfb0f74",
   "metadata": {},
   "outputs": [],
   "source": [
    "pd.options.display.max_rows=10"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 51,
   "id": "1624733f",
   "metadata": {},
   "outputs": [],
   "source": [
    "result = pd.read_csv('examples/Retail_Transaction_Dataset.csv')"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 52,
   "id": "2b19b4e0",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style scoped>\n",
       "    .dataframe tbody tr th:only-of-type {\n",
       "        vertical-align: middle;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: right;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>CustomerID</th>\n",
       "      <th>ProductID</th>\n",
       "      <th>Quantity</th>\n",
       "      <th>Price</th>\n",
       "      <th>TransactionDate</th>\n",
       "      <th>PaymentMethod</th>\n",
       "      <th>StoreLocation</th>\n",
       "      <th>ProductCategory</th>\n",
       "      <th>DiscountApplied(%)</th>\n",
       "      <th>TotalAmount</th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>0</th>\n",
       "      <td>109318</td>\n",
       "      <td>C</td>\n",
       "      <td>7</td>\n",
       "      <td>80.079844</td>\n",
       "      <td>12/26/2023 12:32</td>\n",
       "      <td>Cash</td>\n",
       "      <td>176 Andrew Cliffs\\nBaileyfort, HI 93354</td>\n",
       "      <td>Books</td>\n",
       "      <td>18.677100</td>\n",
       "      <td>455.862764</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>1</th>\n",
       "      <td>993229</td>\n",
       "      <td>C</td>\n",
       "      <td>4</td>\n",
       "      <td>75.195229</td>\n",
       "      <td>8/5/2023 0:00</td>\n",
       "      <td>Cash</td>\n",
       "      <td>11635 William Well Suite 809\\nEast Kara, MT 19483</td>\n",
       "      <td>Home Decor</td>\n",
       "      <td>14.121365</td>\n",
       "      <td>258.306546</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2</th>\n",
       "      <td>579675</td>\n",
       "      <td>A</td>\n",
       "      <td>8</td>\n",
       "      <td>31.528816</td>\n",
       "      <td>3/11/2024 18:51</td>\n",
       "      <td>Cash</td>\n",
       "      <td>910 Mendez Ville Suite 909\\nPort Lauraland, MO...</td>\n",
       "      <td>Books</td>\n",
       "      <td>15.943701</td>\n",
       "      <td>212.015651</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>3</th>\n",
       "      <td>799826</td>\n",
       "      <td>D</td>\n",
       "      <td>5</td>\n",
       "      <td>98.880218</td>\n",
       "      <td>10/27/2023 22:00</td>\n",
       "      <td>PayPal</td>\n",
       "      <td>87522 Sharon Corners Suite 500\\nLake Tammy, MO...</td>\n",
       "      <td>Books</td>\n",
       "      <td>6.686337</td>\n",
       "      <td>461.343769</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>4</th>\n",
       "      <td>121413</td>\n",
       "      <td>A</td>\n",
       "      <td>7</td>\n",
       "      <td>93.188512</td>\n",
       "      <td>12/22/2023 11:38</td>\n",
       "      <td>Cash</td>\n",
       "      <td>0070 Michelle Island Suite 143\\nHoland, VA 80142</td>\n",
       "      <td>Electronics</td>\n",
       "      <td>4.030096</td>\n",
       "      <td>626.030484</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>...</th>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>99995</th>\n",
       "      <td>726461</td>\n",
       "      <td>A</td>\n",
       "      <td>2</td>\n",
       "      <td>56.078258</td>\n",
       "      <td>7/17/2023 16:59</td>\n",
       "      <td>Credit Card</td>\n",
       "      <td>3632 Darren Station Apt. 553\\nEricaborough, RI...</td>\n",
       "      <td>Clothing</td>\n",
       "      <td>18.345145</td>\n",
       "      <td>91.581240</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>99996</th>\n",
       "      <td>328056</td>\n",
       "      <td>A</td>\n",
       "      <td>6</td>\n",
       "      <td>88.516406</td>\n",
       "      <td>5/30/2023 9:04</td>\n",
       "      <td>Credit Card</td>\n",
       "      <td>821 Taylor Shoals\\nEvansville, IL 70845</td>\n",
       "      <td>Electronics</td>\n",
       "      <td>3.995541</td>\n",
       "      <td>509.878179</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>99997</th>\n",
       "      <td>887304</td>\n",
       "      <td>B</td>\n",
       "      <td>4</td>\n",
       "      <td>72.385564</td>\n",
       "      <td>8/25/2023 7:59</td>\n",
       "      <td>Credit Card</td>\n",
       "      <td>50653 Kara Lakes\\nStephanieborough, RI 94492</td>\n",
       "      <td>Clothing</td>\n",
       "      <td>17.423979</td>\n",
       "      <td>239.092472</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>99998</th>\n",
       "      <td>326401</td>\n",
       "      <td>C</td>\n",
       "      <td>5</td>\n",
       "      <td>66.542239</td>\n",
       "      <td>2/5/2024 19:45</td>\n",
       "      <td>PayPal</td>\n",
       "      <td>18756 Mcfarland Way Suite 866\\nBarnettside, PR...</td>\n",
       "      <td>Electronics</td>\n",
       "      <td>14.345018</td>\n",
       "      <td>284.983717</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>99999</th>\n",
       "      <td>771566</td>\n",
       "      <td>C</td>\n",
       "      <td>5</td>\n",
       "      <td>38.087766</td>\n",
       "      <td>2/4/2024 11:53</td>\n",
       "      <td>Debit Card</td>\n",
       "      <td>8046 Hull Drive\\nPaulstad, GU 87218</td>\n",
       "      <td>Home Decor</td>\n",
       "      <td>2.966058</td>\n",
       "      <td>184.790305</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "<p>100000 rows × 10 columns</p>\n",
       "</div>"
      ],
      "text/plain": [
       "       CustomerID ProductID  Quantity      Price   TransactionDate  \\\n",
       "0          109318         C         7  80.079844  12/26/2023 12:32   \n",
       "1          993229         C         4  75.195229     8/5/2023 0:00   \n",
       "2          579675         A         8  31.528816   3/11/2024 18:51   \n",
       "3          799826         D         5  98.880218  10/27/2023 22:00   \n",
       "4          121413         A         7  93.188512  12/22/2023 11:38   \n",
       "...           ...       ...       ...        ...               ...   \n",
       "99995      726461         A         2  56.078258   7/17/2023 16:59   \n",
       "99996      328056         A         6  88.516406    5/30/2023 9:04   \n",
       "99997      887304         B         4  72.385564    8/25/2023 7:59   \n",
       "99998      326401         C         5  66.542239    2/5/2024 19:45   \n",
       "99999      771566         C         5  38.087766    2/4/2024 11:53   \n",
       "\n",
       "      PaymentMethod                                      StoreLocation  \\\n",
       "0              Cash            176 Andrew Cliffs\\nBaileyfort, HI 93354   \n",
       "1              Cash  11635 William Well Suite 809\\nEast Kara, MT 19483   \n",
       "2              Cash  910 Mendez Ville Suite 909\\nPort Lauraland, MO...   \n",
       "3            PayPal  87522 Sharon Corners Suite 500\\nLake Tammy, MO...   \n",
       "4              Cash   0070 Michelle Island Suite 143\\nHoland, VA 80142   \n",
       "...             ...                                                ...   \n",
       "99995   Credit Card  3632 Darren Station Apt. 553\\nEricaborough, RI...   \n",
       "99996   Credit Card            821 Taylor Shoals\\nEvansville, IL 70845   \n",
       "99997   Credit Card       50653 Kara Lakes\\nStephanieborough, RI 94492   \n",
       "99998        PayPal  18756 Mcfarland Way Suite 866\\nBarnettside, PR...   \n",
       "99999    Debit Card                8046 Hull Drive\\nPaulstad, GU 87218   \n",
       "\n",
       "      ProductCategory  DiscountApplied(%)  TotalAmount  \n",
       "0               Books           18.677100   455.862764  \n",
       "1          Home Decor           14.121365   258.306546  \n",
       "2               Books           15.943701   212.015651  \n",
       "3               Books            6.686337   461.343769  \n",
       "4         Electronics            4.030096   626.030484  \n",
       "...               ...                 ...          ...  \n",
       "99995        Clothing           18.345145    91.581240  \n",
       "99996     Electronics            3.995541   509.878179  \n",
       "99997        Clothing           17.423979   239.092472  \n",
       "99998     Electronics           14.345018   284.983717  \n",
       "99999      Home Decor            2.966058   184.790305  \n",
       "\n",
       "[100000 rows x 10 columns]"
      ]
     },
     "execution_count": 52,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "result"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 53,
   "id": "a30fb44f",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style scoped>\n",
       "    .dataframe tbody tr th:only-of-type {\n",
       "        vertical-align: middle;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: right;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>CustomerID</th>\n",
       "      <th>Quantity</th>\n",
       "      <th>Price</th>\n",
       "      <th>DiscountApplied(%)</th>\n",
       "      <th>TotalAmount</th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>count</th>\n",
       "      <td>100000.000000</td>\n",
       "      <td>100000.000000</td>\n",
       "      <td>100000.000000</td>\n",
       "      <td>100000.000000</td>\n",
       "      <td>100000.000000</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>mean</th>\n",
       "      <td>500463.982180</td>\n",
       "      <td>5.009290</td>\n",
       "      <td>55.067344</td>\n",
       "      <td>10.020155</td>\n",
       "      <td>248.334955</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>std</th>\n",
       "      <td>288460.917524</td>\n",
       "      <td>2.579808</td>\n",
       "      <td>25.971567</td>\n",
       "      <td>5.779534</td>\n",
       "      <td>184.554792</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>min</th>\n",
       "      <td>14.000000</td>\n",
       "      <td>1.000000</td>\n",
       "      <td>10.000430</td>\n",
       "      <td>0.000046</td>\n",
       "      <td>8.274825</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>25%</th>\n",
       "      <td>250693.750000</td>\n",
       "      <td>3.000000</td>\n",
       "      <td>32.549474</td>\n",
       "      <td>5.001013</td>\n",
       "      <td>95.163418</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>50%</th>\n",
       "      <td>499679.000000</td>\n",
       "      <td>5.000000</td>\n",
       "      <td>55.116789</td>\n",
       "      <td>10.030353</td>\n",
       "      <td>200.368393</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>75%</th>\n",
       "      <td>751104.750000</td>\n",
       "      <td>7.000000</td>\n",
       "      <td>77.456763</td>\n",
       "      <td>15.018367</td>\n",
       "      <td>362.009980</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>max</th>\n",
       "      <td>999997.000000</td>\n",
       "      <td>9.000000</td>\n",
       "      <td>99.999284</td>\n",
       "      <td>19.999585</td>\n",
       "      <td>896.141242</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "</div>"
      ],
      "text/plain": [
       "          CustomerID       Quantity          Price  DiscountApplied(%)  \\\n",
       "count  100000.000000  100000.000000  100000.000000       100000.000000   \n",
       "mean   500463.982180       5.009290      55.067344           10.020155   \n",
       "std    288460.917524       2.579808      25.971567            5.779534   \n",
       "min        14.000000       1.000000      10.000430            0.000046   \n",
       "25%    250693.750000       3.000000      32.549474            5.001013   \n",
       "50%    499679.000000       5.000000      55.116789           10.030353   \n",
       "75%    751104.750000       7.000000      77.456763           15.018367   \n",
       "max    999997.000000       9.000000      99.999284           19.999585   \n",
       "\n",
       "         TotalAmount  \n",
       "count  100000.000000  \n",
       "mean      248.334955  \n",
       "std       184.554792  \n",
       "min         8.274825  \n",
       "25%        95.163418  \n",
       "50%       200.368393  \n",
       "75%       362.009980  \n",
       "max       896.141242  "
      ]
     },
     "execution_count": 53,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "result.describe()"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 54,
   "id": "c0b581f7",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style scoped>\n",
       "    .dataframe tbody tr th:only-of-type {\n",
       "        vertical-align: middle;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: right;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>CustomerID</th>\n",
       "      <th>ProductID</th>\n",
       "      <th>Quantity</th>\n",
       "      <th>Price</th>\n",
       "      <th>TransactionDate</th>\n",
       "      <th>PaymentMethod</th>\n",
       "      <th>StoreLocation</th>\n",
       "      <th>ProductCategory</th>\n",
       "      <th>DiscountApplied(%)</th>\n",
       "      <th>TotalAmount</th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>0</th>\n",
       "      <td>109318</td>\n",
       "      <td>C</td>\n",
       "      <td>7</td>\n",
       "      <td>80.079844</td>\n",
       "      <td>12/26/2023 12:32</td>\n",
       "      <td>Cash</td>\n",
       "      <td>176 Andrew Cliffs\\nBaileyfort, HI 93354</td>\n",
       "      <td>Books</td>\n",
       "      <td>18.677100</td>\n",
       "      <td>455.862764</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>1</th>\n",
       "      <td>993229</td>\n",
       "      <td>C</td>\n",
       "      <td>4</td>\n",
       "      <td>75.195229</td>\n",
       "      <td>8/5/2023 0:00</td>\n",
       "      <td>Cash</td>\n",
       "      <td>11635 William Well Suite 809\\nEast Kara, MT 19483</td>\n",
       "      <td>Home Decor</td>\n",
       "      <td>14.121365</td>\n",
       "      <td>258.306546</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2</th>\n",
       "      <td>579675</td>\n",
       "      <td>A</td>\n",
       "      <td>8</td>\n",
       "      <td>31.528816</td>\n",
       "      <td>3/11/2024 18:51</td>\n",
       "      <td>Cash</td>\n",
       "      <td>910 Mendez Ville Suite 909\\nPort Lauraland, MO...</td>\n",
       "      <td>Books</td>\n",
       "      <td>15.943701</td>\n",
       "      <td>212.015651</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "</div>"
      ],
      "text/plain": [
       "   CustomerID ProductID  Quantity      Price   TransactionDate PaymentMethod  \\\n",
       "0      109318         C         7  80.079844  12/26/2023 12:32          Cash   \n",
       "1      993229         C         4  75.195229     8/5/2023 0:00          Cash   \n",
       "2      579675         A         8  31.528816   3/11/2024 18:51          Cash   \n",
       "\n",
       "                                       StoreLocation ProductCategory  \\\n",
       "0            176 Andrew Cliffs\\nBaileyfort, HI 93354           Books   \n",
       "1  11635 William Well Suite 809\\nEast Kara, MT 19483      Home Decor   \n",
       "2  910 Mendez Ville Suite 909\\nPort Lauraland, MO...           Books   \n",
       "\n",
       "   DiscountApplied(%)  TotalAmount  \n",
       "0           18.677100   455.862764  \n",
       "1           14.121365   258.306546  \n",
       "2           15.943701   212.015651  "
      ]
     },
     "execution_count": 54,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "result.head(3)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 55,
   "id": "f10af934",
   "metadata": {},
   "outputs": [],
   "source": [
    "df = pd.get_dummies( result, columns = ['ProductID'] )"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 56,
   "id": "afee9f6a",
   "metadata": {},
   "outputs": [
    {
     "ename": "NameError",
     "evalue": "name 'DF' is not defined",
     "output_type": "error",
     "traceback": [
      "\u001b[1;31m---------------------------------------------------------------------------\u001b[0m",
      "\u001b[1;31mNameError\u001b[0m                                 Traceback (most recent call last)",
      "Cell \u001b[1;32mIn[56], line 1\u001b[0m\n\u001b[1;32m----> 1\u001b[0m \u001b[43mDF\u001b[49m\n",
      "\u001b[1;31mNameError\u001b[0m: name 'DF' is not defined"
     ]
    }
   ],
   "source": [
    "DF"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 57,
   "id": "a771496c",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style scoped>\n",
       "    .dataframe tbody tr th:only-of-type {\n",
       "        vertical-align: middle;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: right;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>CustomerID</th>\n",
       "      <th>Quantity</th>\n",
       "      <th>Price</th>\n",
       "      <th>TransactionDate</th>\n",
       "      <th>PaymentMethod</th>\n",
       "      <th>StoreLocation</th>\n",
       "      <th>ProductCategory</th>\n",
       "      <th>DiscountApplied(%)</th>\n",
       "      <th>TotalAmount</th>\n",
       "      <th>ProductID_A</th>\n",
       "      <th>ProductID_B</th>\n",
       "      <th>ProductID_C</th>\n",
       "      <th>ProductID_D</th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>0</th>\n",
       "      <td>109318</td>\n",
       "      <td>7</td>\n",
       "      <td>80.079844</td>\n",
       "      <td>12/26/2023 12:32</td>\n",
       "      <td>Cash</td>\n",
       "      <td>176 Andrew Cliffs\\nBaileyfort, HI 93354</td>\n",
       "      <td>Books</td>\n",
       "      <td>18.677100</td>\n",
       "      <td>455.862764</td>\n",
       "      <td>False</td>\n",
       "      <td>False</td>\n",
       "      <td>True</td>\n",
       "      <td>False</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>1</th>\n",
       "      <td>993229</td>\n",
       "      <td>4</td>\n",
       "      <td>75.195229</td>\n",
       "      <td>8/5/2023 0:00</td>\n",
       "      <td>Cash</td>\n",
       "      <td>11635 William Well Suite 809\\nEast Kara, MT 19483</td>\n",
       "      <td>Home Decor</td>\n",
       "      <td>14.121365</td>\n",
       "      <td>258.306546</td>\n",
       "      <td>False</td>\n",
       "      <td>False</td>\n",
       "      <td>True</td>\n",
       "      <td>False</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2</th>\n",
       "      <td>579675</td>\n",
       "      <td>8</td>\n",
       "      <td>31.528816</td>\n",
       "      <td>3/11/2024 18:51</td>\n",
       "      <td>Cash</td>\n",
       "      <td>910 Mendez Ville Suite 909\\nPort Lauraland, MO...</td>\n",
       "      <td>Books</td>\n",
       "      <td>15.943701</td>\n",
       "      <td>212.015651</td>\n",
       "      <td>True</td>\n",
       "      <td>False</td>\n",
       "      <td>False</td>\n",
       "      <td>False</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>3</th>\n",
       "      <td>799826</td>\n",
       "      <td>5</td>\n",
       "      <td>98.880218</td>\n",
       "      <td>10/27/2023 22:00</td>\n",
       "      <td>PayPal</td>\n",
       "      <td>87522 Sharon Corners Suite 500\\nLake Tammy, MO...</td>\n",
       "      <td>Books</td>\n",
       "      <td>6.686337</td>\n",
       "      <td>461.343769</td>\n",
       "      <td>False</td>\n",
       "      <td>False</td>\n",
       "      <td>False</td>\n",
       "      <td>True</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>4</th>\n",
       "      <td>121413</td>\n",
       "      <td>7</td>\n",
       "      <td>93.188512</td>\n",
       "      <td>12/22/2023 11:38</td>\n",
       "      <td>Cash</td>\n",
       "      <td>0070 Michelle Island Suite 143\\nHoland, VA 80142</td>\n",
       "      <td>Electronics</td>\n",
       "      <td>4.030096</td>\n",
       "      <td>626.030484</td>\n",
       "      <td>True</td>\n",
       "      <td>False</td>\n",
       "      <td>False</td>\n",
       "      <td>False</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>...</th>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>99995</th>\n",
       "      <td>726461</td>\n",
       "      <td>2</td>\n",
       "      <td>56.078258</td>\n",
       "      <td>7/17/2023 16:59</td>\n",
       "      <td>Credit Card</td>\n",
       "      <td>3632 Darren Station Apt. 553\\nEricaborough, RI...</td>\n",
       "      <td>Clothing</td>\n",
       "      <td>18.345145</td>\n",
       "      <td>91.581240</td>\n",
       "      <td>True</td>\n",
       "      <td>False</td>\n",
       "      <td>False</td>\n",
       "      <td>False</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>99996</th>\n",
       "      <td>328056</td>\n",
       "      <td>6</td>\n",
       "      <td>88.516406</td>\n",
       "      <td>5/30/2023 9:04</td>\n",
       "      <td>Credit Card</td>\n",
       "      <td>821 Taylor Shoals\\nEvansville, IL 70845</td>\n",
       "      <td>Electronics</td>\n",
       "      <td>3.995541</td>\n",
       "      <td>509.878179</td>\n",
       "      <td>True</td>\n",
       "      <td>False</td>\n",
       "      <td>False</td>\n",
       "      <td>False</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>99997</th>\n",
       "      <td>887304</td>\n",
       "      <td>4</td>\n",
       "      <td>72.385564</td>\n",
       "      <td>8/25/2023 7:59</td>\n",
       "      <td>Credit Card</td>\n",
       "      <td>50653 Kara Lakes\\nStephanieborough, RI 94492</td>\n",
       "      <td>Clothing</td>\n",
       "      <td>17.423979</td>\n",
       "      <td>239.092472</td>\n",
       "      <td>False</td>\n",
       "      <td>True</td>\n",
       "      <td>False</td>\n",
       "      <td>False</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>99998</th>\n",
       "      <td>326401</td>\n",
       "      <td>5</td>\n",
       "      <td>66.542239</td>\n",
       "      <td>2/5/2024 19:45</td>\n",
       "      <td>PayPal</td>\n",
       "      <td>18756 Mcfarland Way Suite 866\\nBarnettside, PR...</td>\n",
       "      <td>Electronics</td>\n",
       "      <td>14.345018</td>\n",
       "      <td>284.983717</td>\n",
       "      <td>False</td>\n",
       "      <td>False</td>\n",
       "      <td>True</td>\n",
       "      <td>False</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>99999</th>\n",
       "      <td>771566</td>\n",
       "      <td>5</td>\n",
       "      <td>38.087766</td>\n",
       "      <td>2/4/2024 11:53</td>\n",
       "      <td>Debit Card</td>\n",
       "      <td>8046 Hull Drive\\nPaulstad, GU 87218</td>\n",
       "      <td>Home Decor</td>\n",
       "      <td>2.966058</td>\n",
       "      <td>184.790305</td>\n",
       "      <td>False</td>\n",
       "      <td>False</td>\n",
       "      <td>True</td>\n",
       "      <td>False</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "<p>100000 rows × 13 columns</p>\n",
       "</div>"
      ],
      "text/plain": [
       "       CustomerID  Quantity      Price   TransactionDate PaymentMethod  \\\n",
       "0          109318         7  80.079844  12/26/2023 12:32          Cash   \n",
       "1          993229         4  75.195229     8/5/2023 0:00          Cash   \n",
       "2          579675         8  31.528816   3/11/2024 18:51          Cash   \n",
       "3          799826         5  98.880218  10/27/2023 22:00        PayPal   \n",
       "4          121413         7  93.188512  12/22/2023 11:38          Cash   \n",
       "...           ...       ...        ...               ...           ...   \n",
       "99995      726461         2  56.078258   7/17/2023 16:59   Credit Card   \n",
       "99996      328056         6  88.516406    5/30/2023 9:04   Credit Card   \n",
       "99997      887304         4  72.385564    8/25/2023 7:59   Credit Card   \n",
       "99998      326401         5  66.542239    2/5/2024 19:45        PayPal   \n",
       "99999      771566         5  38.087766    2/4/2024 11:53    Debit Card   \n",
       "\n",
       "                                           StoreLocation ProductCategory  \\\n",
       "0                176 Andrew Cliffs\\nBaileyfort, HI 93354           Books   \n",
       "1      11635 William Well Suite 809\\nEast Kara, MT 19483      Home Decor   \n",
       "2      910 Mendez Ville Suite 909\\nPort Lauraland, MO...           Books   \n",
       "3      87522 Sharon Corners Suite 500\\nLake Tammy, MO...           Books   \n",
       "4       0070 Michelle Island Suite 143\\nHoland, VA 80142     Electronics   \n",
       "...                                                  ...             ...   \n",
       "99995  3632 Darren Station Apt. 553\\nEricaborough, RI...        Clothing   \n",
       "99996            821 Taylor Shoals\\nEvansville, IL 70845     Electronics   \n",
       "99997       50653 Kara Lakes\\nStephanieborough, RI 94492        Clothing   \n",
       "99998  18756 Mcfarland Way Suite 866\\nBarnettside, PR...     Electronics   \n",
       "99999                8046 Hull Drive\\nPaulstad, GU 87218      Home Decor   \n",
       "\n",
       "       DiscountApplied(%)  TotalAmount  ProductID_A  ProductID_B  ProductID_C  \\\n",
       "0               18.677100   455.862764        False        False         True   \n",
       "1               14.121365   258.306546        False        False         True   \n",
       "2               15.943701   212.015651         True        False        False   \n",
       "3                6.686337   461.343769        False        False        False   \n",
       "4                4.030096   626.030484         True        False        False   \n",
       "...                   ...          ...          ...          ...          ...   \n",
       "99995           18.345145    91.581240         True        False        False   \n",
       "99996            3.995541   509.878179         True        False        False   \n",
       "99997           17.423979   239.092472        False         True        False   \n",
       "99998           14.345018   284.983717        False        False         True   \n",
       "99999            2.966058   184.790305        False        False         True   \n",
       "\n",
       "       ProductID_D  \n",
       "0            False  \n",
       "1            False  \n",
       "2            False  \n",
       "3             True  \n",
       "4            False  \n",
       "...            ...  \n",
       "99995        False  \n",
       "99996        False  \n",
       "99997        False  \n",
       "99998        False  \n",
       "99999        False  \n",
       "\n",
       "[100000 rows x 13 columns]"
      ]
     },
     "execution_count": 57,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "df"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 58,
   "id": "95414d44",
   "metadata": {},
   "outputs": [],
   "source": [
    "y=result.Price"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 59,
   "id": "59601d7e",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "0        80.079844\n",
       "1        75.195229\n",
       "2        31.528816\n",
       "3        98.880218\n",
       "4        93.188512\n",
       "           ...    \n",
       "99995    56.078258\n",
       "99996    88.516406\n",
       "99997    72.385564\n",
       "99998    66.542239\n",
       "99999    38.087766\n",
       "Name: Price, Length: 100000, dtype: float64"
      ]
     },
     "execution_count": 59,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "y"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 60,
   "id": "c5add043",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "pandas.core.series.Series"
      ]
     },
     "execution_count": 60,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "type(y)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 61,
   "id": "06e2b645",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style scoped>\n",
       "    .dataframe tbody tr th:only-of-type {\n",
       "        vertical-align: middle;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: right;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>CustomerID</th>\n",
       "      <th>ProductID</th>\n",
       "      <th>Quantity</th>\n",
       "      <th>Price</th>\n",
       "      <th>TransactionDate</th>\n",
       "      <th>PaymentMethod</th>\n",
       "      <th>StoreLocation</th>\n",
       "      <th>ProductCategory</th>\n",
       "      <th>DiscountApplied(%)</th>\n",
       "      <th>TotalAmount</th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>0</th>\n",
       "      <td>False</td>\n",
       "      <td>False</td>\n",
       "      <td>False</td>\n",
       "      <td>False</td>\n",
       "      <td>False</td>\n",
       "      <td>False</td>\n",
       "      <td>False</td>\n",
       "      <td>False</td>\n",
       "      <td>False</td>\n",
       "      <td>False</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>1</th>\n",
       "      <td>False</td>\n",
       "      <td>False</td>\n",
       "      <td>False</td>\n",
       "      <td>False</td>\n",
       "      <td>False</td>\n",
       "      <td>False</td>\n",
       "      <td>False</td>\n",
       "      <td>False</td>\n",
       "      <td>False</td>\n",
       "      <td>False</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2</th>\n",
       "      <td>False</td>\n",
       "      <td>False</td>\n",
       "      <td>False</td>\n",
       "      <td>False</td>\n",
       "      <td>False</td>\n",
       "      <td>False</td>\n",
       "      <td>False</td>\n",
       "      <td>False</td>\n",
       "      <td>False</td>\n",
       "      <td>False</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>3</th>\n",
       "      <td>False</td>\n",
       "      <td>False</td>\n",
       "      <td>False</td>\n",
       "      <td>False</td>\n",
       "      <td>False</td>\n",
       "      <td>False</td>\n",
       "      <td>False</td>\n",
       "      <td>False</td>\n",
       "      <td>False</td>\n",
       "      <td>False</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>4</th>\n",
       "      <td>False</td>\n",
       "      <td>False</td>\n",
       "      <td>False</td>\n",
       "      <td>False</td>\n",
       "      <td>False</td>\n",
       "      <td>False</td>\n",
       "      <td>False</td>\n",
       "      <td>False</td>\n",
       "      <td>False</td>\n",
       "      <td>False</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>...</th>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>99995</th>\n",
       "      <td>False</td>\n",
       "      <td>False</td>\n",
       "      <td>False</td>\n",
       "      <td>False</td>\n",
       "      <td>False</td>\n",
       "      <td>False</td>\n",
       "      <td>False</td>\n",
       "      <td>False</td>\n",
       "      <td>False</td>\n",
       "      <td>False</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>99996</th>\n",
       "      <td>False</td>\n",
       "      <td>False</td>\n",
       "      <td>False</td>\n",
       "      <td>False</td>\n",
       "      <td>False</td>\n",
       "      <td>False</td>\n",
       "      <td>False</td>\n",
       "      <td>False</td>\n",
       "      <td>False</td>\n",
       "      <td>False</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>99997</th>\n",
       "      <td>False</td>\n",
       "      <td>False</td>\n",
       "      <td>False</td>\n",
       "      <td>False</td>\n",
       "      <td>False</td>\n",
       "      <td>False</td>\n",
       "      <td>False</td>\n",
       "      <td>False</td>\n",
       "      <td>False</td>\n",
       "      <td>False</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>99998</th>\n",
       "      <td>False</td>\n",
       "      <td>False</td>\n",
       "      <td>False</td>\n",
       "      <td>False</td>\n",
       "      <td>False</td>\n",
       "      <td>False</td>\n",
       "      <td>False</td>\n",
       "      <td>False</td>\n",
       "      <td>False</td>\n",
       "      <td>False</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>99999</th>\n",
       "      <td>False</td>\n",
       "      <td>False</td>\n",
       "      <td>False</td>\n",
       "      <td>False</td>\n",
       "      <td>False</td>\n",
       "      <td>False</td>\n",
       "      <td>False</td>\n",
       "      <td>False</td>\n",
       "      <td>False</td>\n",
       "      <td>False</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "<p>100000 rows × 10 columns</p>\n",
       "</div>"
      ],
      "text/plain": [
       "       CustomerID  ProductID  Quantity  Price  TransactionDate  PaymentMethod  \\\n",
       "0           False      False     False  False            False          False   \n",
       "1           False      False     False  False            False          False   \n",
       "2           False      False     False  False            False          False   \n",
       "3           False      False     False  False            False          False   \n",
       "4           False      False     False  False            False          False   \n",
       "...           ...        ...       ...    ...              ...            ...   \n",
       "99995       False      False     False  False            False          False   \n",
       "99996       False      False     False  False            False          False   \n",
       "99997       False      False     False  False            False          False   \n",
       "99998       False      False     False  False            False          False   \n",
       "99999       False      False     False  False            False          False   \n",
       "\n",
       "       StoreLocation  ProductCategory  DiscountApplied(%)  TotalAmount  \n",
       "0              False            False               False        False  \n",
       "1              False            False               False        False  \n",
       "2              False            False               False        False  \n",
       "3              False            False               False        False  \n",
       "4              False            False               False        False  \n",
       "...              ...              ...                 ...          ...  \n",
       "99995          False            False               False        False  \n",
       "99996          False            False               False        False  \n",
       "99997          False            False               False        False  \n",
       "99998          False            False               False        False  \n",
       "99999          False            False               False        False  \n",
       "\n",
       "[100000 rows x 10 columns]"
      ]
     },
     "execution_count": 61,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "pd.isnull(result)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 62,
   "id": "b6711fe4",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "CustomerID            0\n",
       "ProductID             0\n",
       "Quantity              0\n",
       "Price                 0\n",
       "TransactionDate       0\n",
       "PaymentMethod         0\n",
       "StoreLocation         0\n",
       "ProductCategory       0\n",
       "DiscountApplied(%)    0\n",
       "TotalAmount           0\n",
       "dtype: int64"
      ]
     },
     "execution_count": 62,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "pd.isnull(result).sum()"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 63,
   "id": "f319d583",
   "metadata": {
    "collapsed": true
   },
   "outputs": [
    {
     "ename": "FileNotFoundError",
     "evalue": "[Errno 2] No such file or directory: 'examples/2.1-table.csv'",
     "output_type": "error",
     "traceback": [
      "\u001b[1;31m---------------------------------------------------------------------------\u001b[0m",
      "\u001b[1;31mFileNotFoundError\u001b[0m                         Traceback (most recent call last)",
      "Cell \u001b[1;32mIn[63], line 1\u001b[0m\n\u001b[1;32m----> 1\u001b[0m df \u001b[38;5;241m=\u001b[39m \u001b[43mpd\u001b[49m\u001b[38;5;241;43m.\u001b[39;49m\u001b[43mread_csv\u001b[49m\u001b[43m(\u001b[49m\u001b[38;5;124;43m'\u001b[39;49m\u001b[38;5;124;43mexamples/2.1-table.csv\u001b[39;49m\u001b[38;5;124;43m'\u001b[39;49m\u001b[43m)\u001b[49m\n",
      "File \u001b[1;32mD:\\miniconda3\\envs\\pydata-book\\lib\\site-packages\\pandas\\io\\parsers\\readers.py:912\u001b[0m, in \u001b[0;36mread_csv\u001b[1;34m(filepath_or_buffer, sep, delimiter, header, names, index_col, usecols, dtype, engine, converters, true_values, false_values, skipinitialspace, skiprows, skipfooter, nrows, na_values, keep_default_na, na_filter, verbose, skip_blank_lines, parse_dates, infer_datetime_format, keep_date_col, date_parser, date_format, dayfirst, cache_dates, iterator, chunksize, compression, thousands, decimal, lineterminator, quotechar, quoting, doublequote, escapechar, comment, encoding, encoding_errors, dialect, on_bad_lines, delim_whitespace, low_memory, memory_map, float_precision, storage_options, dtype_backend)\u001b[0m\n\u001b[0;32m    899\u001b[0m kwds_defaults \u001b[38;5;241m=\u001b[39m _refine_defaults_read(\n\u001b[0;32m    900\u001b[0m     dialect,\n\u001b[0;32m    901\u001b[0m     delimiter,\n\u001b[1;32m   (...)\u001b[0m\n\u001b[0;32m    908\u001b[0m     dtype_backend\u001b[38;5;241m=\u001b[39mdtype_backend,\n\u001b[0;32m    909\u001b[0m )\n\u001b[0;32m    910\u001b[0m kwds\u001b[38;5;241m.\u001b[39mupdate(kwds_defaults)\n\u001b[1;32m--> 912\u001b[0m \u001b[38;5;28;01mreturn\u001b[39;00m \u001b[43m_read\u001b[49m\u001b[43m(\u001b[49m\u001b[43mfilepath_or_buffer\u001b[49m\u001b[43m,\u001b[49m\u001b[43m \u001b[49m\u001b[43mkwds\u001b[49m\u001b[43m)\u001b[49m\n",
      "File \u001b[1;32mD:\\miniconda3\\envs\\pydata-book\\lib\\site-packages\\pandas\\io\\parsers\\readers.py:577\u001b[0m, in \u001b[0;36m_read\u001b[1;34m(filepath_or_buffer, kwds)\u001b[0m\n\u001b[0;32m    574\u001b[0m _validate_names(kwds\u001b[38;5;241m.\u001b[39mget(\u001b[38;5;124m\"\u001b[39m\u001b[38;5;124mnames\u001b[39m\u001b[38;5;124m\"\u001b[39m, \u001b[38;5;28;01mNone\u001b[39;00m))\n\u001b[0;32m    576\u001b[0m \u001b[38;5;66;03m# Create the parser.\u001b[39;00m\n\u001b[1;32m--> 577\u001b[0m parser \u001b[38;5;241m=\u001b[39m \u001b[43mTextFileReader\u001b[49m\u001b[43m(\u001b[49m\u001b[43mfilepath_or_buffer\u001b[49m\u001b[43m,\u001b[49m\u001b[43m \u001b[49m\u001b[38;5;241;43m*\u001b[39;49m\u001b[38;5;241;43m*\u001b[39;49m\u001b[43mkwds\u001b[49m\u001b[43m)\u001b[49m\n\u001b[0;32m    579\u001b[0m \u001b[38;5;28;01mif\u001b[39;00m chunksize \u001b[38;5;129;01mor\u001b[39;00m iterator:\n\u001b[0;32m    580\u001b[0m     \u001b[38;5;28;01mreturn\u001b[39;00m parser\n",
      "File \u001b[1;32mD:\\miniconda3\\envs\\pydata-book\\lib\\site-packages\\pandas\\io\\parsers\\readers.py:1407\u001b[0m, in \u001b[0;36mTextFileReader.__init__\u001b[1;34m(self, f, engine, **kwds)\u001b[0m\n\u001b[0;32m   1404\u001b[0m     \u001b[38;5;28mself\u001b[39m\u001b[38;5;241m.\u001b[39moptions[\u001b[38;5;124m\"\u001b[39m\u001b[38;5;124mhas_index_names\u001b[39m\u001b[38;5;124m\"\u001b[39m] \u001b[38;5;241m=\u001b[39m kwds[\u001b[38;5;124m\"\u001b[39m\u001b[38;5;124mhas_index_names\u001b[39m\u001b[38;5;124m\"\u001b[39m]\n\u001b[0;32m   1406\u001b[0m \u001b[38;5;28mself\u001b[39m\u001b[38;5;241m.\u001b[39mhandles: IOHandles \u001b[38;5;241m|\u001b[39m \u001b[38;5;28;01mNone\u001b[39;00m \u001b[38;5;241m=\u001b[39m \u001b[38;5;28;01mNone\u001b[39;00m\n\u001b[1;32m-> 1407\u001b[0m \u001b[38;5;28mself\u001b[39m\u001b[38;5;241m.\u001b[39m_engine \u001b[38;5;241m=\u001b[39m \u001b[38;5;28;43mself\u001b[39;49m\u001b[38;5;241;43m.\u001b[39;49m\u001b[43m_make_engine\u001b[49m\u001b[43m(\u001b[49m\u001b[43mf\u001b[49m\u001b[43m,\u001b[49m\u001b[43m \u001b[49m\u001b[38;5;28;43mself\u001b[39;49m\u001b[38;5;241;43m.\u001b[39;49m\u001b[43mengine\u001b[49m\u001b[43m)\u001b[49m\n",
      "File \u001b[1;32mD:\\miniconda3\\envs\\pydata-book\\lib\\site-packages\\pandas\\io\\parsers\\readers.py:1661\u001b[0m, in \u001b[0;36mTextFileReader._make_engine\u001b[1;34m(self, f, engine)\u001b[0m\n\u001b[0;32m   1659\u001b[0m     \u001b[38;5;28;01mif\u001b[39;00m \u001b[38;5;124m\"\u001b[39m\u001b[38;5;124mb\u001b[39m\u001b[38;5;124m\"\u001b[39m \u001b[38;5;129;01mnot\u001b[39;00m \u001b[38;5;129;01min\u001b[39;00m mode:\n\u001b[0;32m   1660\u001b[0m         mode \u001b[38;5;241m+\u001b[39m\u001b[38;5;241m=\u001b[39m \u001b[38;5;124m\"\u001b[39m\u001b[38;5;124mb\u001b[39m\u001b[38;5;124m\"\u001b[39m\n\u001b[1;32m-> 1661\u001b[0m \u001b[38;5;28mself\u001b[39m\u001b[38;5;241m.\u001b[39mhandles \u001b[38;5;241m=\u001b[39m \u001b[43mget_handle\u001b[49m\u001b[43m(\u001b[49m\n\u001b[0;32m   1662\u001b[0m \u001b[43m    \u001b[49m\u001b[43mf\u001b[49m\u001b[43m,\u001b[49m\n\u001b[0;32m   1663\u001b[0m \u001b[43m    \u001b[49m\u001b[43mmode\u001b[49m\u001b[43m,\u001b[49m\n\u001b[0;32m   1664\u001b[0m \u001b[43m    \u001b[49m\u001b[43mencoding\u001b[49m\u001b[38;5;241;43m=\u001b[39;49m\u001b[38;5;28;43mself\u001b[39;49m\u001b[38;5;241;43m.\u001b[39;49m\u001b[43moptions\u001b[49m\u001b[38;5;241;43m.\u001b[39;49m\u001b[43mget\u001b[49m\u001b[43m(\u001b[49m\u001b[38;5;124;43m\"\u001b[39;49m\u001b[38;5;124;43mencoding\u001b[39;49m\u001b[38;5;124;43m\"\u001b[39;49m\u001b[43m,\u001b[49m\u001b[43m \u001b[49m\u001b[38;5;28;43;01mNone\u001b[39;49;00m\u001b[43m)\u001b[49m\u001b[43m,\u001b[49m\n\u001b[0;32m   1665\u001b[0m \u001b[43m    \u001b[49m\u001b[43mcompression\u001b[49m\u001b[38;5;241;43m=\u001b[39;49m\u001b[38;5;28;43mself\u001b[39;49m\u001b[38;5;241;43m.\u001b[39;49m\u001b[43moptions\u001b[49m\u001b[38;5;241;43m.\u001b[39;49m\u001b[43mget\u001b[49m\u001b[43m(\u001b[49m\u001b[38;5;124;43m\"\u001b[39;49m\u001b[38;5;124;43mcompression\u001b[39;49m\u001b[38;5;124;43m\"\u001b[39;49m\u001b[43m,\u001b[49m\u001b[43m \u001b[49m\u001b[38;5;28;43;01mNone\u001b[39;49;00m\u001b[43m)\u001b[49m\u001b[43m,\u001b[49m\n\u001b[0;32m   1666\u001b[0m \u001b[43m    \u001b[49m\u001b[43mmemory_map\u001b[49m\u001b[38;5;241;43m=\u001b[39;49m\u001b[38;5;28;43mself\u001b[39;49m\u001b[38;5;241;43m.\u001b[39;49m\u001b[43moptions\u001b[49m\u001b[38;5;241;43m.\u001b[39;49m\u001b[43mget\u001b[49m\u001b[43m(\u001b[49m\u001b[38;5;124;43m\"\u001b[39;49m\u001b[38;5;124;43mmemory_map\u001b[39;49m\u001b[38;5;124;43m\"\u001b[39;49m\u001b[43m,\u001b[49m\u001b[43m \u001b[49m\u001b[38;5;28;43;01mFalse\u001b[39;49;00m\u001b[43m)\u001b[49m\u001b[43m,\u001b[49m\n\u001b[0;32m   1667\u001b[0m \u001b[43m    \u001b[49m\u001b[43mis_text\u001b[49m\u001b[38;5;241;43m=\u001b[39;49m\u001b[43mis_text\u001b[49m\u001b[43m,\u001b[49m\n\u001b[0;32m   1668\u001b[0m \u001b[43m    \u001b[49m\u001b[43merrors\u001b[49m\u001b[38;5;241;43m=\u001b[39;49m\u001b[38;5;28;43mself\u001b[39;49m\u001b[38;5;241;43m.\u001b[39;49m\u001b[43moptions\u001b[49m\u001b[38;5;241;43m.\u001b[39;49m\u001b[43mget\u001b[49m\u001b[43m(\u001b[49m\u001b[38;5;124;43m\"\u001b[39;49m\u001b[38;5;124;43mencoding_errors\u001b[39;49m\u001b[38;5;124;43m\"\u001b[39;49m\u001b[43m,\u001b[49m\u001b[43m \u001b[49m\u001b[38;5;124;43m\"\u001b[39;49m\u001b[38;5;124;43mstrict\u001b[39;49m\u001b[38;5;124;43m\"\u001b[39;49m\u001b[43m)\u001b[49m\u001b[43m,\u001b[49m\n\u001b[0;32m   1669\u001b[0m \u001b[43m    \u001b[49m\u001b[43mstorage_options\u001b[49m\u001b[38;5;241;43m=\u001b[39;49m\u001b[38;5;28;43mself\u001b[39;49m\u001b[38;5;241;43m.\u001b[39;49m\u001b[43moptions\u001b[49m\u001b[38;5;241;43m.\u001b[39;49m\u001b[43mget\u001b[49m\u001b[43m(\u001b[49m\u001b[38;5;124;43m\"\u001b[39;49m\u001b[38;5;124;43mstorage_options\u001b[39;49m\u001b[38;5;124;43m\"\u001b[39;49m\u001b[43m,\u001b[49m\u001b[43m \u001b[49m\u001b[38;5;28;43;01mNone\u001b[39;49;00m\u001b[43m)\u001b[49m\u001b[43m,\u001b[49m\n\u001b[0;32m   1670\u001b[0m \u001b[43m\u001b[49m\u001b[43m)\u001b[49m\n\u001b[0;32m   1671\u001b[0m \u001b[38;5;28;01massert\u001b[39;00m \u001b[38;5;28mself\u001b[39m\u001b[38;5;241m.\u001b[39mhandles \u001b[38;5;129;01mis\u001b[39;00m \u001b[38;5;129;01mnot\u001b[39;00m \u001b[38;5;28;01mNone\u001b[39;00m\n\u001b[0;32m   1672\u001b[0m f \u001b[38;5;241m=\u001b[39m \u001b[38;5;28mself\u001b[39m\u001b[38;5;241m.\u001b[39mhandles\u001b[38;5;241m.\u001b[39mhandle\n",
      "File \u001b[1;32mD:\\miniconda3\\envs\\pydata-book\\lib\\site-packages\\pandas\\io\\common.py:859\u001b[0m, in \u001b[0;36mget_handle\u001b[1;34m(path_or_buf, mode, encoding, compression, memory_map, is_text, errors, storage_options)\u001b[0m\n\u001b[0;32m    854\u001b[0m \u001b[38;5;28;01melif\u001b[39;00m \u001b[38;5;28misinstance\u001b[39m(handle, \u001b[38;5;28mstr\u001b[39m):\n\u001b[0;32m    855\u001b[0m     \u001b[38;5;66;03m# Check whether the filename is to be opened in binary mode.\u001b[39;00m\n\u001b[0;32m    856\u001b[0m     \u001b[38;5;66;03m# Binary mode does not support 'encoding' and 'newline'.\u001b[39;00m\n\u001b[0;32m    857\u001b[0m     \u001b[38;5;28;01mif\u001b[39;00m ioargs\u001b[38;5;241m.\u001b[39mencoding \u001b[38;5;129;01mand\u001b[39;00m \u001b[38;5;124m\"\u001b[39m\u001b[38;5;124mb\u001b[39m\u001b[38;5;124m\"\u001b[39m \u001b[38;5;129;01mnot\u001b[39;00m \u001b[38;5;129;01min\u001b[39;00m ioargs\u001b[38;5;241m.\u001b[39mmode:\n\u001b[0;32m    858\u001b[0m         \u001b[38;5;66;03m# Encoding\u001b[39;00m\n\u001b[1;32m--> 859\u001b[0m         handle \u001b[38;5;241m=\u001b[39m \u001b[38;5;28;43mopen\u001b[39;49m\u001b[43m(\u001b[49m\n\u001b[0;32m    860\u001b[0m \u001b[43m            \u001b[49m\u001b[43mhandle\u001b[49m\u001b[43m,\u001b[49m\n\u001b[0;32m    861\u001b[0m \u001b[43m            \u001b[49m\u001b[43mioargs\u001b[49m\u001b[38;5;241;43m.\u001b[39;49m\u001b[43mmode\u001b[49m\u001b[43m,\u001b[49m\n\u001b[0;32m    862\u001b[0m \u001b[43m            \u001b[49m\u001b[43mencoding\u001b[49m\u001b[38;5;241;43m=\u001b[39;49m\u001b[43mioargs\u001b[49m\u001b[38;5;241;43m.\u001b[39;49m\u001b[43mencoding\u001b[49m\u001b[43m,\u001b[49m\n\u001b[0;32m    863\u001b[0m \u001b[43m            \u001b[49m\u001b[43merrors\u001b[49m\u001b[38;5;241;43m=\u001b[39;49m\u001b[43merrors\u001b[49m\u001b[43m,\u001b[49m\n\u001b[0;32m    864\u001b[0m \u001b[43m            \u001b[49m\u001b[43mnewline\u001b[49m\u001b[38;5;241;43m=\u001b[39;49m\u001b[38;5;124;43m\"\u001b[39;49m\u001b[38;5;124;43m\"\u001b[39;49m\u001b[43m,\u001b[49m\n\u001b[0;32m    865\u001b[0m \u001b[43m        \u001b[49m\u001b[43m)\u001b[49m\n\u001b[0;32m    866\u001b[0m     \u001b[38;5;28;01melse\u001b[39;00m:\n\u001b[0;32m    867\u001b[0m         \u001b[38;5;66;03m# Binary mode\u001b[39;00m\n\u001b[0;32m    868\u001b[0m         handle \u001b[38;5;241m=\u001b[39m \u001b[38;5;28mopen\u001b[39m(handle, ioargs\u001b[38;5;241m.\u001b[39mmode)\n",
      "\u001b[1;31mFileNotFoundError\u001b[0m: [Errno 2] No such file or directory: 'examples/2.1-table.csv'"
     ]
    }
   ],
   "source": [
    "df = pd.read_csv('examples/2.1-table.csv')"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 64,
   "id": "577a2aab",
   "metadata": {
    "collapsed": true
   },
   "outputs": [
    {
     "ename": "FileNotFoundError",
     "evalue": "[Errno 2] No such file or directory: '/examples/2.1-table.csv'",
     "output_type": "error",
     "traceback": [
      "\u001b[1;31m---------------------------------------------------------------------------\u001b[0m",
      "\u001b[1;31mFileNotFoundError\u001b[0m                         Traceback (most recent call last)",
      "Cell \u001b[1;32mIn[64], line 1\u001b[0m\n\u001b[1;32m----> 1\u001b[0m df \u001b[38;5;241m=\u001b[39m \u001b[43mpd\u001b[49m\u001b[38;5;241;43m.\u001b[39;49m\u001b[43mread_csv\u001b[49m\u001b[43m(\u001b[49m\u001b[38;5;124;43m'\u001b[39;49m\u001b[38;5;124;43m/examples/2.1-table.csv\u001b[39;49m\u001b[38;5;124;43m'\u001b[39;49m\u001b[43m)\u001b[49m\n",
      "File \u001b[1;32mD:\\miniconda3\\envs\\pydata-book\\lib\\site-packages\\pandas\\io\\parsers\\readers.py:912\u001b[0m, in \u001b[0;36mread_csv\u001b[1;34m(filepath_or_buffer, sep, delimiter, header, names, index_col, usecols, dtype, engine, converters, true_values, false_values, skipinitialspace, skiprows, skipfooter, nrows, na_values, keep_default_na, na_filter, verbose, skip_blank_lines, parse_dates, infer_datetime_format, keep_date_col, date_parser, date_format, dayfirst, cache_dates, iterator, chunksize, compression, thousands, decimal, lineterminator, quotechar, quoting, doublequote, escapechar, comment, encoding, encoding_errors, dialect, on_bad_lines, delim_whitespace, low_memory, memory_map, float_precision, storage_options, dtype_backend)\u001b[0m\n\u001b[0;32m    899\u001b[0m kwds_defaults \u001b[38;5;241m=\u001b[39m _refine_defaults_read(\n\u001b[0;32m    900\u001b[0m     dialect,\n\u001b[0;32m    901\u001b[0m     delimiter,\n\u001b[1;32m   (...)\u001b[0m\n\u001b[0;32m    908\u001b[0m     dtype_backend\u001b[38;5;241m=\u001b[39mdtype_backend,\n\u001b[0;32m    909\u001b[0m )\n\u001b[0;32m    910\u001b[0m kwds\u001b[38;5;241m.\u001b[39mupdate(kwds_defaults)\n\u001b[1;32m--> 912\u001b[0m \u001b[38;5;28;01mreturn\u001b[39;00m \u001b[43m_read\u001b[49m\u001b[43m(\u001b[49m\u001b[43mfilepath_or_buffer\u001b[49m\u001b[43m,\u001b[49m\u001b[43m \u001b[49m\u001b[43mkwds\u001b[49m\u001b[43m)\u001b[49m\n",
      "File \u001b[1;32mD:\\miniconda3\\envs\\pydata-book\\lib\\site-packages\\pandas\\io\\parsers\\readers.py:577\u001b[0m, in \u001b[0;36m_read\u001b[1;34m(filepath_or_buffer, kwds)\u001b[0m\n\u001b[0;32m    574\u001b[0m _validate_names(kwds\u001b[38;5;241m.\u001b[39mget(\u001b[38;5;124m\"\u001b[39m\u001b[38;5;124mnames\u001b[39m\u001b[38;5;124m\"\u001b[39m, \u001b[38;5;28;01mNone\u001b[39;00m))\n\u001b[0;32m    576\u001b[0m \u001b[38;5;66;03m# Create the parser.\u001b[39;00m\n\u001b[1;32m--> 577\u001b[0m parser \u001b[38;5;241m=\u001b[39m \u001b[43mTextFileReader\u001b[49m\u001b[43m(\u001b[49m\u001b[43mfilepath_or_buffer\u001b[49m\u001b[43m,\u001b[49m\u001b[43m \u001b[49m\u001b[38;5;241;43m*\u001b[39;49m\u001b[38;5;241;43m*\u001b[39;49m\u001b[43mkwds\u001b[49m\u001b[43m)\u001b[49m\n\u001b[0;32m    579\u001b[0m \u001b[38;5;28;01mif\u001b[39;00m chunksize \u001b[38;5;129;01mor\u001b[39;00m iterator:\n\u001b[0;32m    580\u001b[0m     \u001b[38;5;28;01mreturn\u001b[39;00m parser\n",
      "File \u001b[1;32mD:\\miniconda3\\envs\\pydata-book\\lib\\site-packages\\pandas\\io\\parsers\\readers.py:1407\u001b[0m, in \u001b[0;36mTextFileReader.__init__\u001b[1;34m(self, f, engine, **kwds)\u001b[0m\n\u001b[0;32m   1404\u001b[0m     \u001b[38;5;28mself\u001b[39m\u001b[38;5;241m.\u001b[39moptions[\u001b[38;5;124m\"\u001b[39m\u001b[38;5;124mhas_index_names\u001b[39m\u001b[38;5;124m\"\u001b[39m] \u001b[38;5;241m=\u001b[39m kwds[\u001b[38;5;124m\"\u001b[39m\u001b[38;5;124mhas_index_names\u001b[39m\u001b[38;5;124m\"\u001b[39m]\n\u001b[0;32m   1406\u001b[0m \u001b[38;5;28mself\u001b[39m\u001b[38;5;241m.\u001b[39mhandles: IOHandles \u001b[38;5;241m|\u001b[39m \u001b[38;5;28;01mNone\u001b[39;00m \u001b[38;5;241m=\u001b[39m \u001b[38;5;28;01mNone\u001b[39;00m\n\u001b[1;32m-> 1407\u001b[0m \u001b[38;5;28mself\u001b[39m\u001b[38;5;241m.\u001b[39m_engine \u001b[38;5;241m=\u001b[39m \u001b[38;5;28;43mself\u001b[39;49m\u001b[38;5;241;43m.\u001b[39;49m\u001b[43m_make_engine\u001b[49m\u001b[43m(\u001b[49m\u001b[43mf\u001b[49m\u001b[43m,\u001b[49m\u001b[43m \u001b[49m\u001b[38;5;28;43mself\u001b[39;49m\u001b[38;5;241;43m.\u001b[39;49m\u001b[43mengine\u001b[49m\u001b[43m)\u001b[49m\n",
      "File \u001b[1;32mD:\\miniconda3\\envs\\pydata-book\\lib\\site-packages\\pandas\\io\\parsers\\readers.py:1661\u001b[0m, in \u001b[0;36mTextFileReader._make_engine\u001b[1;34m(self, f, engine)\u001b[0m\n\u001b[0;32m   1659\u001b[0m     \u001b[38;5;28;01mif\u001b[39;00m \u001b[38;5;124m\"\u001b[39m\u001b[38;5;124mb\u001b[39m\u001b[38;5;124m\"\u001b[39m \u001b[38;5;129;01mnot\u001b[39;00m \u001b[38;5;129;01min\u001b[39;00m mode:\n\u001b[0;32m   1660\u001b[0m         mode \u001b[38;5;241m+\u001b[39m\u001b[38;5;241m=\u001b[39m \u001b[38;5;124m\"\u001b[39m\u001b[38;5;124mb\u001b[39m\u001b[38;5;124m\"\u001b[39m\n\u001b[1;32m-> 1661\u001b[0m \u001b[38;5;28mself\u001b[39m\u001b[38;5;241m.\u001b[39mhandles \u001b[38;5;241m=\u001b[39m \u001b[43mget_handle\u001b[49m\u001b[43m(\u001b[49m\n\u001b[0;32m   1662\u001b[0m \u001b[43m    \u001b[49m\u001b[43mf\u001b[49m\u001b[43m,\u001b[49m\n\u001b[0;32m   1663\u001b[0m \u001b[43m    \u001b[49m\u001b[43mmode\u001b[49m\u001b[43m,\u001b[49m\n\u001b[0;32m   1664\u001b[0m \u001b[43m    \u001b[49m\u001b[43mencoding\u001b[49m\u001b[38;5;241;43m=\u001b[39;49m\u001b[38;5;28;43mself\u001b[39;49m\u001b[38;5;241;43m.\u001b[39;49m\u001b[43moptions\u001b[49m\u001b[38;5;241;43m.\u001b[39;49m\u001b[43mget\u001b[49m\u001b[43m(\u001b[49m\u001b[38;5;124;43m\"\u001b[39;49m\u001b[38;5;124;43mencoding\u001b[39;49m\u001b[38;5;124;43m\"\u001b[39;49m\u001b[43m,\u001b[49m\u001b[43m \u001b[49m\u001b[38;5;28;43;01mNone\u001b[39;49;00m\u001b[43m)\u001b[49m\u001b[43m,\u001b[49m\n\u001b[0;32m   1665\u001b[0m \u001b[43m    \u001b[49m\u001b[43mcompression\u001b[49m\u001b[38;5;241;43m=\u001b[39;49m\u001b[38;5;28;43mself\u001b[39;49m\u001b[38;5;241;43m.\u001b[39;49m\u001b[43moptions\u001b[49m\u001b[38;5;241;43m.\u001b[39;49m\u001b[43mget\u001b[49m\u001b[43m(\u001b[49m\u001b[38;5;124;43m\"\u001b[39;49m\u001b[38;5;124;43mcompression\u001b[39;49m\u001b[38;5;124;43m\"\u001b[39;49m\u001b[43m,\u001b[49m\u001b[43m \u001b[49m\u001b[38;5;28;43;01mNone\u001b[39;49;00m\u001b[43m)\u001b[49m\u001b[43m,\u001b[49m\n\u001b[0;32m   1666\u001b[0m \u001b[43m    \u001b[49m\u001b[43mmemory_map\u001b[49m\u001b[38;5;241;43m=\u001b[39;49m\u001b[38;5;28;43mself\u001b[39;49m\u001b[38;5;241;43m.\u001b[39;49m\u001b[43moptions\u001b[49m\u001b[38;5;241;43m.\u001b[39;49m\u001b[43mget\u001b[49m\u001b[43m(\u001b[49m\u001b[38;5;124;43m\"\u001b[39;49m\u001b[38;5;124;43mmemory_map\u001b[39;49m\u001b[38;5;124;43m\"\u001b[39;49m\u001b[43m,\u001b[49m\u001b[43m \u001b[49m\u001b[38;5;28;43;01mFalse\u001b[39;49;00m\u001b[43m)\u001b[49m\u001b[43m,\u001b[49m\n\u001b[0;32m   1667\u001b[0m \u001b[43m    \u001b[49m\u001b[43mis_text\u001b[49m\u001b[38;5;241;43m=\u001b[39;49m\u001b[43mis_text\u001b[49m\u001b[43m,\u001b[49m\n\u001b[0;32m   1668\u001b[0m \u001b[43m    \u001b[49m\u001b[43merrors\u001b[49m\u001b[38;5;241;43m=\u001b[39;49m\u001b[38;5;28;43mself\u001b[39;49m\u001b[38;5;241;43m.\u001b[39;49m\u001b[43moptions\u001b[49m\u001b[38;5;241;43m.\u001b[39;49m\u001b[43mget\u001b[49m\u001b[43m(\u001b[49m\u001b[38;5;124;43m\"\u001b[39;49m\u001b[38;5;124;43mencoding_errors\u001b[39;49m\u001b[38;5;124;43m\"\u001b[39;49m\u001b[43m,\u001b[49m\u001b[43m \u001b[49m\u001b[38;5;124;43m\"\u001b[39;49m\u001b[38;5;124;43mstrict\u001b[39;49m\u001b[38;5;124;43m\"\u001b[39;49m\u001b[43m)\u001b[49m\u001b[43m,\u001b[49m\n\u001b[0;32m   1669\u001b[0m \u001b[43m    \u001b[49m\u001b[43mstorage_options\u001b[49m\u001b[38;5;241;43m=\u001b[39;49m\u001b[38;5;28;43mself\u001b[39;49m\u001b[38;5;241;43m.\u001b[39;49m\u001b[43moptions\u001b[49m\u001b[38;5;241;43m.\u001b[39;49m\u001b[43mget\u001b[49m\u001b[43m(\u001b[49m\u001b[38;5;124;43m\"\u001b[39;49m\u001b[38;5;124;43mstorage_options\u001b[39;49m\u001b[38;5;124;43m\"\u001b[39;49m\u001b[43m,\u001b[49m\u001b[43m \u001b[49m\u001b[38;5;28;43;01mNone\u001b[39;49;00m\u001b[43m)\u001b[49m\u001b[43m,\u001b[49m\n\u001b[0;32m   1670\u001b[0m \u001b[43m\u001b[49m\u001b[43m)\u001b[49m\n\u001b[0;32m   1671\u001b[0m \u001b[38;5;28;01massert\u001b[39;00m \u001b[38;5;28mself\u001b[39m\u001b[38;5;241m.\u001b[39mhandles \u001b[38;5;129;01mis\u001b[39;00m \u001b[38;5;129;01mnot\u001b[39;00m \u001b[38;5;28;01mNone\u001b[39;00m\n\u001b[0;32m   1672\u001b[0m f \u001b[38;5;241m=\u001b[39m \u001b[38;5;28mself\u001b[39m\u001b[38;5;241m.\u001b[39mhandles\u001b[38;5;241m.\u001b[39mhandle\n",
      "File \u001b[1;32mD:\\miniconda3\\envs\\pydata-book\\lib\\site-packages\\pandas\\io\\common.py:859\u001b[0m, in \u001b[0;36mget_handle\u001b[1;34m(path_or_buf, mode, encoding, compression, memory_map, is_text, errors, storage_options)\u001b[0m\n\u001b[0;32m    854\u001b[0m \u001b[38;5;28;01melif\u001b[39;00m \u001b[38;5;28misinstance\u001b[39m(handle, \u001b[38;5;28mstr\u001b[39m):\n\u001b[0;32m    855\u001b[0m     \u001b[38;5;66;03m# Check whether the filename is to be opened in binary mode.\u001b[39;00m\n\u001b[0;32m    856\u001b[0m     \u001b[38;5;66;03m# Binary mode does not support 'encoding' and 'newline'.\u001b[39;00m\n\u001b[0;32m    857\u001b[0m     \u001b[38;5;28;01mif\u001b[39;00m ioargs\u001b[38;5;241m.\u001b[39mencoding \u001b[38;5;129;01mand\u001b[39;00m \u001b[38;5;124m\"\u001b[39m\u001b[38;5;124mb\u001b[39m\u001b[38;5;124m\"\u001b[39m \u001b[38;5;129;01mnot\u001b[39;00m \u001b[38;5;129;01min\u001b[39;00m ioargs\u001b[38;5;241m.\u001b[39mmode:\n\u001b[0;32m    858\u001b[0m         \u001b[38;5;66;03m# Encoding\u001b[39;00m\n\u001b[1;32m--> 859\u001b[0m         handle \u001b[38;5;241m=\u001b[39m \u001b[38;5;28;43mopen\u001b[39;49m\u001b[43m(\u001b[49m\n\u001b[0;32m    860\u001b[0m \u001b[43m            \u001b[49m\u001b[43mhandle\u001b[49m\u001b[43m,\u001b[49m\n\u001b[0;32m    861\u001b[0m \u001b[43m            \u001b[49m\u001b[43mioargs\u001b[49m\u001b[38;5;241;43m.\u001b[39;49m\u001b[43mmode\u001b[49m\u001b[43m,\u001b[49m\n\u001b[0;32m    862\u001b[0m \u001b[43m            \u001b[49m\u001b[43mencoding\u001b[49m\u001b[38;5;241;43m=\u001b[39;49m\u001b[43mioargs\u001b[49m\u001b[38;5;241;43m.\u001b[39;49m\u001b[43mencoding\u001b[49m\u001b[43m,\u001b[49m\n\u001b[0;32m    863\u001b[0m \u001b[43m            \u001b[49m\u001b[43merrors\u001b[49m\u001b[38;5;241;43m=\u001b[39;49m\u001b[43merrors\u001b[49m\u001b[43m,\u001b[49m\n\u001b[0;32m    864\u001b[0m \u001b[43m            \u001b[49m\u001b[43mnewline\u001b[49m\u001b[38;5;241;43m=\u001b[39;49m\u001b[38;5;124;43m\"\u001b[39;49m\u001b[38;5;124;43m\"\u001b[39;49m\u001b[43m,\u001b[49m\n\u001b[0;32m    865\u001b[0m \u001b[43m        \u001b[49m\u001b[43m)\u001b[49m\n\u001b[0;32m    866\u001b[0m     \u001b[38;5;28;01melse\u001b[39;00m:\n\u001b[0;32m    867\u001b[0m         \u001b[38;5;66;03m# Binary mode\u001b[39;00m\n\u001b[0;32m    868\u001b[0m         handle \u001b[38;5;241m=\u001b[39m \u001b[38;5;28mopen\u001b[39m(handle, ioargs\u001b[38;5;241m.\u001b[39mmode)\n",
      "\u001b[1;31mFileNotFoundError\u001b[0m: [Errno 2] No such file or directory: '/examples/2.1-table.csv'"
     ]
    }
   ],
   "source": [
    "df = pd.read_csv('examples/2.1-table.csv')"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 65,
   "id": "321ab515",
   "metadata": {},
   "outputs": [],
   "source": [
    "df = pd.read_csv('examples/2.1-table.csv')"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 66,
   "id": "b08a2eac",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style scoped>\n",
       "    .dataframe tbody tr th:only-of-type {\n",
       "        vertical-align: middle;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: right;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>Friend</th>\n",
       "      <th>Max temp(C)</th>\n",
       "      <th>Weight (kg)</th>\n",
       "      <th>Height(cm)</th>\n",
       "      <th>Gender</th>\n",
       "      <th>Company</th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>0</th>\n",
       "      <td>Andrew</td>\n",
       "      <td>25</td>\n",
       "      <td>77</td>\n",
       "      <td>175</td>\n",
       "      <td>M</td>\n",
       "      <td>Good</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>1</th>\n",
       "      <td>Bernhard</td>\n",
       "      <td>31</td>\n",
       "      <td>110</td>\n",
       "      <td>195</td>\n",
       "      <td>M</td>\n",
       "      <td>Good</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2</th>\n",
       "      <td>Carolina</td>\n",
       "      <td>15</td>\n",
       "      <td>70</td>\n",
       "      <td>172</td>\n",
       "      <td>F</td>\n",
       "      <td>Bad</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>3</th>\n",
       "      <td>Dennis</td>\n",
       "      <td>20</td>\n",
       "      <td>85</td>\n",
       "      <td>180</td>\n",
       "      <td>M</td>\n",
       "      <td>Good</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>4</th>\n",
       "      <td>Eve</td>\n",
       "      <td>10</td>\n",
       "      <td>65</td>\n",
       "      <td>168</td>\n",
       "      <td>F</td>\n",
       "      <td>Bad</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>...</th>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>9</th>\n",
       "      <td>James</td>\n",
       "      <td>21</td>\n",
       "      <td>66</td>\n",
       "      <td>163</td>\n",
       "      <td>M</td>\n",
       "      <td>Good</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>10</th>\n",
       "      <td>Kevin</td>\n",
       "      <td>30</td>\n",
       "      <td>95</td>\n",
       "      <td>190</td>\n",
       "      <td>M</td>\n",
       "      <td>Bad</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>11</th>\n",
       "      <td>Lea</td>\n",
       "      <td>13</td>\n",
       "      <td>72</td>\n",
       "      <td>172</td>\n",
       "      <td>F</td>\n",
       "      <td>Good</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>12</th>\n",
       "      <td>Marcus</td>\n",
       "      <td>8</td>\n",
       "      <td>83</td>\n",
       "      <td>185</td>\n",
       "      <td>F</td>\n",
       "      <td>Bad</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>13</th>\n",
       "      <td>Nigel</td>\n",
       "      <td>12</td>\n",
       "      <td>115</td>\n",
       "      <td>192</td>\n",
       "      <td>M</td>\n",
       "      <td>Good</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "<p>14 rows × 6 columns</p>\n",
       "</div>"
      ],
      "text/plain": [
       "      Friend  Max temp(C)  Weight (kg)  Height(cm) Gender Company\n",
       "0     Andrew           25           77         175      M    Good\n",
       "1   Bernhard           31          110         195      M    Good\n",
       "2   Carolina           15           70         172      F     Bad\n",
       "3     Dennis           20           85         180      M    Good\n",
       "4        Eve           10           65         168      F     Bad\n",
       "..       ...          ...          ...         ...    ...     ...\n",
       "9      James           21           66         163      M    Good\n",
       "10     Kevin           30           95         190      M     Bad\n",
       "11       Lea           13           72         172      F    Good\n",
       "12    Marcus            8           83         185      F     Bad\n",
       "13     Nigel           12          115         192      M    Good\n",
       "\n",
       "[14 rows x 6 columns]"
      ]
     },
     "execution_count": 66,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "df"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 1,
   "id": "22205292",
   "metadata": {},
   "outputs": [],
   "source": [
    "import pandas as pd"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 2,
   "id": "f02a07ee",
   "metadata": {},
   "outputs": [],
   "source": [
    "df = pd.read_csv('examples/Table-8.1.csv')"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 3,
   "id": "74b970b5",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style scoped>\n",
       "    .dataframe tbody tr th:only-of-type {\n",
       "        vertical-align: middle;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: right;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>Friend</th>\n",
       "      <th>Weight (kg)</th>\n",
       "      <th>Height (cm)</th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>0</th>\n",
       "      <td>Andrew</td>\n",
       "      <td>77</td>\n",
       "      <td>175</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>1</th>\n",
       "      <td>Bernhard</td>\n",
       "      <td>110</td>\n",
       "      <td>195</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2</th>\n",
       "      <td>Carolina</td>\n",
       "      <td>70</td>\n",
       "      <td>172</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>3</th>\n",
       "      <td>Dennis</td>\n",
       "      <td>85</td>\n",
       "      <td>180</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>4</th>\n",
       "      <td>Eve</td>\n",
       "      <td>65</td>\n",
       "      <td>168</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>5</th>\n",
       "      <td>Fred</td>\n",
       "      <td>75</td>\n",
       "      <td>173</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>6</th>\n",
       "      <td>Gwyneth</td>\n",
       "      <td>75</td>\n",
       "      <td>180</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>7</th>\n",
       "      <td>Hayden</td>\n",
       "      <td>63</td>\n",
       "      <td>165</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>8</th>\n",
       "      <td>Irene</td>\n",
       "      <td>55</td>\n",
       "      <td>158</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>9</th>\n",
       "      <td>James</td>\n",
       "      <td>66</td>\n",
       "      <td>163</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>10</th>\n",
       "      <td>Kevin</td>\n",
       "      <td>95</td>\n",
       "      <td>190</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>11</th>\n",
       "      <td>Lea</td>\n",
       "      <td>72</td>\n",
       "      <td>172</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>12</th>\n",
       "      <td>Marcus</td>\n",
       "      <td>83</td>\n",
       "      <td>185</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>13</th>\n",
       "      <td>Nigel</td>\n",
       "      <td>115</td>\n",
       "      <td>192</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "</div>"
      ],
      "text/plain": [
       "      Friend  Weight (kg)  Height (cm)\n",
       "0     Andrew           77          175\n",
       "1   Bernhard          110          195\n",
       "2   Carolina           70          172\n",
       "3     Dennis           85          180\n",
       "4        Eve           65          168\n",
       "5       Fred           75          173\n",
       "6    Gwyneth           75          180\n",
       "7     Hayden           63          165\n",
       "8      Irene           55          158\n",
       "9      James           66          163\n",
       "10     Kevin           95          190\n",
       "11       Lea           72          172\n",
       "12    Marcus           83          185\n",
       "13     Nigel          115          192"
      ]
     },
     "execution_count": 3,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "df"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 4,
   "id": "6abbf229",
   "metadata": {},
   "outputs": [],
   "source": [
    "import numpy as np"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 5,
   "id": "33466a45",
   "metadata": {},
   "outputs": [
    {
     "ename": "KeyError",
     "evalue": "'Weight(kg)'",
     "output_type": "error",
     "traceback": [
      "\u001b[1;31m---------------------------------------------------------------------------\u001b[0m",
      "\u001b[1;31mKeyError\u001b[0m                                  Traceback (most recent call last)",
      "File \u001b[1;32mD:\\miniconda3\\envs\\pydata-book\\lib\\site-packages\\pandas\\core\\indexes\\base.py:3653\u001b[0m, in \u001b[0;36mIndex.get_loc\u001b[1;34m(self, key)\u001b[0m\n\u001b[0;32m   3652\u001b[0m \u001b[38;5;28;01mtry\u001b[39;00m:\n\u001b[1;32m-> 3653\u001b[0m     \u001b[38;5;28;01mreturn\u001b[39;00m \u001b[38;5;28;43mself\u001b[39;49m\u001b[38;5;241;43m.\u001b[39;49m\u001b[43m_engine\u001b[49m\u001b[38;5;241;43m.\u001b[39;49m\u001b[43mget_loc\u001b[49m\u001b[43m(\u001b[49m\u001b[43mcasted_key\u001b[49m\u001b[43m)\u001b[49m\n\u001b[0;32m   3654\u001b[0m \u001b[38;5;28;01mexcept\u001b[39;00m \u001b[38;5;167;01mKeyError\u001b[39;00m \u001b[38;5;28;01mas\u001b[39;00m err:\n",
      "File \u001b[1;32mD:\\miniconda3\\envs\\pydata-book\\lib\\site-packages\\pandas\\_libs\\index.pyx:147\u001b[0m, in \u001b[0;36mpandas._libs.index.IndexEngine.get_loc\u001b[1;34m()\u001b[0m\n",
      "File \u001b[1;32mD:\\miniconda3\\envs\\pydata-book\\lib\\site-packages\\pandas\\_libs\\index.pyx:176\u001b[0m, in \u001b[0;36mpandas._libs.index.IndexEngine.get_loc\u001b[1;34m()\u001b[0m\n",
      "File \u001b[1;32mpandas\\_libs\\hashtable_class_helper.pxi:7080\u001b[0m, in \u001b[0;36mpandas._libs.hashtable.PyObjectHashTable.get_item\u001b[1;34m()\u001b[0m\n",
      "File \u001b[1;32mpandas\\_libs\\hashtable_class_helper.pxi:7088\u001b[0m, in \u001b[0;36mpandas._libs.hashtable.PyObjectHashTable.get_item\u001b[1;34m()\u001b[0m\n",
      "\u001b[1;31mKeyError\u001b[0m: 'Weight(kg)'",
      "\nThe above exception was the direct cause of the following exception:\n",
      "\u001b[1;31mKeyError\u001b[0m                                  Traceback (most recent call last)",
      "Cell \u001b[1;32mIn[5], line 1\u001b[0m\n\u001b[1;32m----> 1\u001b[0m x \u001b[38;5;241m=\u001b[39m \u001b[43mdf\u001b[49m\u001b[43m[\u001b[49m\u001b[38;5;124;43m'\u001b[39;49m\u001b[38;5;124;43mWeight(kg)\u001b[39;49m\u001b[38;5;124;43m'\u001b[39;49m\u001b[43m]\u001b[49m\u001b[38;5;241m.\u001b[39mvalues\n",
      "File \u001b[1;32mD:\\miniconda3\\envs\\pydata-book\\lib\\site-packages\\pandas\\core\\frame.py:3761\u001b[0m, in \u001b[0;36mDataFrame.__getitem__\u001b[1;34m(self, key)\u001b[0m\n\u001b[0;32m   3759\u001b[0m \u001b[38;5;28;01mif\u001b[39;00m \u001b[38;5;28mself\u001b[39m\u001b[38;5;241m.\u001b[39mcolumns\u001b[38;5;241m.\u001b[39mnlevels \u001b[38;5;241m>\u001b[39m \u001b[38;5;241m1\u001b[39m:\n\u001b[0;32m   3760\u001b[0m     \u001b[38;5;28;01mreturn\u001b[39;00m \u001b[38;5;28mself\u001b[39m\u001b[38;5;241m.\u001b[39m_getitem_multilevel(key)\n\u001b[1;32m-> 3761\u001b[0m indexer \u001b[38;5;241m=\u001b[39m \u001b[38;5;28;43mself\u001b[39;49m\u001b[38;5;241;43m.\u001b[39;49m\u001b[43mcolumns\u001b[49m\u001b[38;5;241;43m.\u001b[39;49m\u001b[43mget_loc\u001b[49m\u001b[43m(\u001b[49m\u001b[43mkey\u001b[49m\u001b[43m)\u001b[49m\n\u001b[0;32m   3762\u001b[0m \u001b[38;5;28;01mif\u001b[39;00m is_integer(indexer):\n\u001b[0;32m   3763\u001b[0m     indexer \u001b[38;5;241m=\u001b[39m [indexer]\n",
      "File \u001b[1;32mD:\\miniconda3\\envs\\pydata-book\\lib\\site-packages\\pandas\\core\\indexes\\base.py:3655\u001b[0m, in \u001b[0;36mIndex.get_loc\u001b[1;34m(self, key)\u001b[0m\n\u001b[0;32m   3653\u001b[0m     \u001b[38;5;28;01mreturn\u001b[39;00m \u001b[38;5;28mself\u001b[39m\u001b[38;5;241m.\u001b[39m_engine\u001b[38;5;241m.\u001b[39mget_loc(casted_key)\n\u001b[0;32m   3654\u001b[0m \u001b[38;5;28;01mexcept\u001b[39;00m \u001b[38;5;167;01mKeyError\u001b[39;00m \u001b[38;5;28;01mas\u001b[39;00m err:\n\u001b[1;32m-> 3655\u001b[0m     \u001b[38;5;28;01mraise\u001b[39;00m \u001b[38;5;167;01mKeyError\u001b[39;00m(key) \u001b[38;5;28;01mfrom\u001b[39;00m \u001b[38;5;21;01merr\u001b[39;00m\n\u001b[0;32m   3656\u001b[0m \u001b[38;5;28;01mexcept\u001b[39;00m \u001b[38;5;167;01mTypeError\u001b[39;00m:\n\u001b[0;32m   3657\u001b[0m     \u001b[38;5;66;03m# If we have a listlike key, _check_indexing_error will raise\u001b[39;00m\n\u001b[0;32m   3658\u001b[0m     \u001b[38;5;66;03m#  InvalidIndexError. Otherwise we fall through and re-raise\u001b[39;00m\n\u001b[0;32m   3659\u001b[0m     \u001b[38;5;66;03m#  the TypeError.\u001b[39;00m\n\u001b[0;32m   3660\u001b[0m     \u001b[38;5;28mself\u001b[39m\u001b[38;5;241m.\u001b[39m_check_indexing_error(key)\n",
      "\u001b[1;31mKeyError\u001b[0m: 'Weight(kg)'"
     ]
    }
   ],
   "source": [
    "x = df['Weight(kg)'].values"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "id": "c4f4757e",
   "metadata": {},
   "outputs": [],
   "source": [
    "x"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 6,
   "id": "d4624860",
   "metadata": {},
   "outputs": [],
   "source": [
    "x = df['Weight (kg)'].values"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 7,
   "id": "aeb52eed",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "array([ 77, 110,  70,  85,  65,  75,  75,  63,  55,  66,  95,  72,  83,\n",
       "       115], dtype=int64)"
      ]
     },
     "execution_count": 7,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "x"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 8,
   "id": "30f2c351",
   "metadata": {},
   "outputs": [],
   "source": [
    "y = df['Height (cm)']"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 9,
   "id": "404e6d75",
   "metadata": {},
   "outputs": [],
   "source": [
    "y = df['Height (cm)'].values"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 10,
   "id": "07cbac28",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "array([175, 195, 172, 180, 168, 173, 180, 165, 158, 163, 190, 172, 185,\n",
       "       192], dtype=int64)"
      ]
     },
     "execution_count": 10,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "y"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 11,
   "id": "8ad17aab",
   "metadata": {},
   "outputs": [],
   "source": [
    "n = len(x)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 12,
   "id": "05d2e349",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "14"
      ]
     },
     "execution_count": 12,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "n"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 13,
   "id": "699b169b",
   "metadata": {},
   "outputs": [],
   "source": [
    "def manual_linear_regression(x, y):\n",
    "    # 计算均值\n",
    "    x_mean = np.mean(x)\n",
    "    y_mean = np.mean(y)\n",
    "    \n",
    "    # 计算斜率 β₁\n",
    "    numerator = np.sum((x - x_mean) * (y - y_mean))\n",
    "    denominator = np.sum((x - x_mean) ** 2)\n",
    "    beta_1 = numerator / denominator\n",
    "    \n",
    "    # 计算截距 β₀\n",
    "    beta_0 = y_mean - beta_1 * x_mean\n",
    "    \n",
    "    return beta_0, beta_1"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 14,
   "id": "d7b99304",
   "metadata": {},
   "outputs": [],
   "source": [
    "beta_0, beta_1 = manual_linear_regression(x, y)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 15,
   "id": "fe0ea9c7",
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "\n",
      "=== 回归结果 ===\n",
      "截距 β₀: 128.0169\n",
      "斜率 β₁: 0.6110\n",
      "回归方程: ŷ = 128.0169 + 0.6110 × Weight\n"
     ]
    }
   ],
   "source": [
    "print(f\"\\n=== 回归结果 ===\")\n",
    "print(f\"截距 β₀: {beta_0:.4f}\")\n",
    "print(f\"斜率 β₁: {beta_1:.4f}\")\n",
    "print(f\"回归方程: ŷ = {beta_0:.4f} + {beta_1:.4f} × Weight\")"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 16,
   "id": "ebb6be4f",
   "metadata": {},
   "outputs": [],
   "source": [
    "def manual_linear_regression(x,y):\n",
    "    # 计算均值\n",
    "    x_mean = np.mean(x)\n",
    "    y_mean = np.mean(y)\n",
    "    \n",
    "    #计算斜率\n",
    "    numerator = np.sum((x - x_mean) * (y - y_mean))\n",
    "    denominator = np.sum((x - x_mean) ** 2)\n",
    "    beta_1 = numerator / denominator\n",
    "    \n",
    "    # 计算截距\n",
    "    beta_0 = y_mean - beta_1 * x_mean\n",
    "    \n",
    "    return beta_0, beta_1"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 17,
   "id": "068e9798",
   "metadata": {},
   "outputs": [],
   "source": [
    "beta_0, beta_1 = manual_linear_regression(x, y)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 18,
   "id": "6bb66d03",
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "\n",
      "=== 回归结果 ===\n",
      "截距 β₀: 128.0169\n",
      "斜率 β₁: 0.6110\n",
      "回归方程: ŷ = 128.0169 + 0.6110 × Weight\n"
     ]
    }
   ],
   "source": [
    "print(f\"\\n=== 回归结果 ===\")\n",
    "print(f\"截距 β₀: {beta_0:.4f}\")\n",
    "print(f\"斜率 β₁: {beta_1:.4f}\")\n",
    "print(f\"回归方程: ŷ = {beta_0:.4f} + {beta_1:.4f} × Weight\")"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 19,
   "id": "99049125",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "array([ 77, 110,  70,  85,  65,  75,  75,  63,  55,  66,  95,  72,  83,\n",
       "       115], dtype=int64)"
      ]
     },
     "execution_count": 19,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "x"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 20,
   "id": "d735c702",
   "metadata": {
    "collapsed": true
   },
   "outputs": [
    {
     "ename": "NameError",
     "evalue": "name 'x_mean' is not defined",
     "output_type": "error",
     "traceback": [
      "\u001b[1;31m---------------------------------------------------------------------------\u001b[0m",
      "\u001b[1;31mNameError\u001b[0m                                 Traceback (most recent call last)",
      "Cell \u001b[1;32mIn[20], line 1\u001b[0m\n\u001b[1;32m----> 1\u001b[0m \u001b[43mx_mean\u001b[49m\n",
      "\u001b[1;31mNameError\u001b[0m: name 'x_mean' is not defined"
     ]
    }
   ],
   "source": [
    "x_mean"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 21,
   "id": "4b5538f6",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "79.0"
      ]
     },
     "execution_count": 21,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "np.mean(x)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 22,
   "id": "f2476fe5",
   "metadata": {},
   "outputs": [],
   "source": [
    "y_pred = beta_0 + beta_1 * x"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 23,
   "id": "9560e459",
   "metadata": {
    "collapsed": true
   },
   "outputs": [
    {
     "data": {
      "text/plain": [
       "array([175.06371836, 195.22665115, 170.78673262, 179.95170207,\n",
       "       167.7317428 , 173.84172243, 173.84172243, 166.50974687,\n",
       "       161.62176317, 168.34274076, 186.0616817 , 172.00872854,\n",
       "       178.72970614, 198.28164097])"
      ]
     },
     "execution_count": 23,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "y_pred"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 24,
   "id": "cec3b003",
   "metadata": {
    "collapsed": true
   },
   "outputs": [
    {
     "data": {
      "text/plain": [
       "array([ 77, 110,  70,  85,  65,  75,  75,  63,  55,  66,  95,  72,  83,\n",
       "       115], dtype=int64)"
      ]
     },
     "execution_count": 24,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "x"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 25,
   "id": "87175065",
   "metadata": {},
   "outputs": [],
   "source": [
    "# 计算MES"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 26,
   "id": "c9e7644a",
   "metadata": {
    "collapsed": true
   },
   "outputs": [
    {
     "data": {
      "text/plain": [
       "array([175, 195, 172, 180, 168, 173, 180, 165, 158, 163, 190, 172, 185,\n",
       "       192], dtype=int64)"
      ]
     },
     "execution_count": 26,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "y"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 27,
   "id": "f6231800",
   "metadata": {},
   "outputs": [],
   "source": [
    "mes = np.mean((y - y_pred) ** 2)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 28,
   "id": "e8d0e74b",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "12.74728791720355"
      ]
     },
     "execution_count": 28,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "mes"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 29,
   "id": "70128072",
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "\n",
      "=== NumPy验证 ===\n",
      "NumPy结果 - β₀: 128.0169, β₁: 0.6110\n"
     ]
    }
   ],
   "source": [
    "print(f\"\\n=== NumPy验证 ===\")\n",
    "coefficients = np.polyfit(x, y, 1)\n",
    "beta_1_np, beta_0_np = coefficients\n",
    "print(f\"NumPy结果 - β₀: {beta_0_np:.4f}, β₁: {beta_1_np:.4f}\")"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 30,
   "id": "355e6395",
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "\n",
      "=== 预测示例 ===\n",
      "Andrew: 实际身高=175cm, 预测身高=175.1cm, 误差=0.1cm\n",
      "Bernhard: 实际身高=195cm, 预测身高=195.2cm, 误差=0.2cm\n",
      "Carolina: 实际身高=172cm, 预测身高=170.8cm, 误差=1.2cm\n"
     ]
    }
   ],
   "source": [
    "print(f\"\\n=== 预测示例 ===\")\n",
    "for i in range(min(3, n)):\n",
    "    actual = y[i]\n",
    "    predicted = beta_0 + beta_1 * x[i]\n",
    "    print(f\"{df['Friend'][i]}: 实际身高={actual}cm, 预测身高={predicted:.1f}cm, 误差={abs(actual-predicted):.1f}cm\")"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 31,
   "id": "b607d4ad",
   "metadata": {
    "collapsed": true
   },
   "outputs": [
    {
     "ename": "NameError",
     "evalue": "name 'plt' is not defined",
     "output_type": "error",
     "traceback": [
      "\u001b[1;31m---------------------------------------------------------------------------\u001b[0m",
      "\u001b[1;31mNameError\u001b[0m                                 Traceback (most recent call last)",
      "Cell \u001b[1;32mIn[31], line 1\u001b[0m\n\u001b[1;32m----> 1\u001b[0m \u001b[43mplt\u001b[49m\u001b[38;5;241m.\u001b[39mfigure(figsize\u001b[38;5;241m=\u001b[39m(\u001b[38;5;241m10\u001b[39m, \u001b[38;5;241m6\u001b[39m))\n\u001b[0;32m      2\u001b[0m plt\u001b[38;5;241m.\u001b[39mscatter(x, y, color\u001b[38;5;241m=\u001b[39m\u001b[38;5;124m'\u001b[39m\u001b[38;5;124mblue\u001b[39m\u001b[38;5;124m'\u001b[39m, alpha\u001b[38;5;241m=\u001b[39m\u001b[38;5;241m0.7\u001b[39m, label\u001b[38;5;241m=\u001b[39m\u001b[38;5;124m'\u001b[39m\u001b[38;5;124m实际数据\u001b[39m\u001b[38;5;124m'\u001b[39m)\n\u001b[0;32m      3\u001b[0m plt\u001b[38;5;241m.\u001b[39mplot(x, y_pred, color\u001b[38;5;241m=\u001b[39m\u001b[38;5;124m'\u001b[39m\u001b[38;5;124mred\u001b[39m\u001b[38;5;124m'\u001b[39m, linewidth\u001b[38;5;241m=\u001b[39m\u001b[38;5;241m2\u001b[39m, label\u001b[38;5;241m=\u001b[39m\u001b[38;5;124m'\u001b[39m\u001b[38;5;124m回归线\u001b[39m\u001b[38;5;124m'\u001b[39m)\n",
      "\u001b[1;31mNameError\u001b[0m: name 'plt' is not defined"
     ]
    }
   ],
   "source": [
    "plt.figure(figsize=(10, 6))\n",
    "plt.scatter(x, y, color='blue', alpha=0.7, label='实际数据')\n",
    "plt.plot(x, y_pred, color='red', linewidth=2, label='回归线')"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 32,
   "id": "b949fa61",
   "metadata": {},
   "outputs": [],
   "source": [
    "import matplotlib.pyplot as plt"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 33,
   "id": "9360fd70",
   "metadata": {
    "collapsed": true
   },
   "outputs": [
    {
     "data": {
      "text/plain": [
       "[<matplotlib.lines.Line2D at 0x2084e501f70>]"
      ]
     },
     "execution_count": 33,
     "metadata": {},
     "output_type": "execute_result"
    },
    {
     "data": {
      "image/png": "iVBORw0KGgoAAAANSUhEUgAAAz8AAAH8CAYAAAD/thFwAAAAOXRFWHRTb2Z0d2FyZQBNYXRwbG90bGliIHZlcnNpb24zLjcuMywgaHR0cHM6Ly9tYXRwbG90bGliLm9yZy/OQEPoAAAACXBIWXMAAA9hAAAPYQGoP6dpAABRgElEQVR4nO3dfVyV9f3H8fcBAfEGBFGBAu+Xis5Etxy60uW8v8u2tHTZMrdKLW9wzTXnaptYs1ob2d0ql1lWK81uzVpqjp8tbxdgqWR5B1qJ4DEC5Fy/P77rFHIOCsJ17l7Px+M8Tuf6XOf4OV0Pizffm8thWZYlAAAAAAhyYb5uAAAAAADsQPgBAAAAEBIIPwAAAABCAuEHAAAAQEgg/AAAAAAICYQfAAAAACGB8AMAAAAgJBB+AAAAAIQEwg8AAACAkED4AQAAABASmtTl5KysLL344ov68MMPFR0drYyMDN1111266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bat2+v6OhoZWRk6P3333fXua7+bdOmTRozZoySk5PlcDi0Zs2aavVzuX7l5eWaNWuWEhIS1Lx5c40dO1aHDh2y8VvgTGe7ri+++KKGDRumhIQEORwO7dy5s8ZncF39A+EH1RQXF2vAgAGKiIjQ66+/rvz8fN1zzz1q1aqV+5y7775b9957r7Kzs/X+++8rMTFRP/7xj3Xy5EnfNY5avf/++yosLHQ/1q9fL0n66U9/KolrGojuuusuPfTQQ8rOztbu3bt19913689//rP+9re/uc/hugamG264QevXr9eKFSv0wQcfaOjQoRoyZIgOHz4sievq706dOqXevXsrOzvbY/1crt/s2bO1evVqrVq1Sps3b5bT6dTo0aNVVVVl19fAGc52XU+dOqUBAwZoyZIlXj+D6+onLOBbbrvtNmvgwIFe6y6Xy0pMTLSWLFniPvbVV19ZsbGx1kMPPWRHi2gAt956q9W5c2fL5XJxTQPUqFGjrOuvv77asQkTJlhTpkyxLIu/q4Hqyy+/tMLDw61XXnml2vHevXtbt99+O9c1wEiyVq9e7X59LtfvxIkTVkREhLVq1Sr3OYcPH7bCwsKsN954w7be4d2Z1/Xb9u/fb0myduzYUe0419V/MPKDatauXat+/frppz/9qdq2bas+ffro0Ucfddf379+voqIiDR061H0sKipKl112mXJycnzRMuqooqJCTz31lK6//no5HA6uaYAaOHCg3n77be3Zs0eStGvXLm3evFkjR46UxN/VQHX69GlVVVWpadOm1Y5HR0dr8+bNXNcAdy7Xb9u2baqsrKx2TnJysnr27Mk1DmBcV/9B+EE1H3/8sR588EF17dpV69at04033qhbbrlFTz75pCSpqKhIktSuXbtq72vXrp27Bv+2Zs0anThxQtddd50krmmguu2223T11VerW7duioiIUJ8+fTR79mxdffXVkriugaply5b6wQ9+oD/84Q86cuSIqqqq9NRTT+m9995TYWEh1zXAncv1KyoqUmRkpOLi4ryeg8DDdfUfTXzdAPyLy+VSv379tHjxYklSnz59lJeXpwcffFDXXnut+zyHw1HtfZZl1TgG//TYY49pxIgRSk5OrnacaxpYnn32WT311FN6+umnlZaWpp07d2r27NlKTk7W1KlT3edxXQPPihUrdP311+uCCy5QeHi40tPTdc0112j79u3uc7iuga0+149rHJy4rvZj5AfVJCUlqUePHtWOde/eXQcOHJAkJSYmSlKN31IcO3asxm+y4H8+/fRTvfXWW7rhhhvcx7imgWn+/Pn69a9/rUmTJqlXr1762c9+pjlz5igrK0sS1zWQde7cWRs3bpTT6dTBgwf1n//8R5WVlerYsSPXNcCdy/VLTExURUWFiouLvZ6DwMN19R+EH1QzYMAAffTRR9WO7dmzR+3bt5ck9/98v94tTDJrSDZu3KiMjAxbe0XdPfHEE2rbtq1GjRrlPsY1DUxffvmlwsKq/yc8PDzcvdU11zXwNW/eXElJSSouLta6des0btw4rmuAO5fr17dvX0VERFQ7p7CwULm5uVzjAMZ19R9Me0M1c+bMUUZGhhYvXqyrrrpK//nPf/TII4/okUcekWSG6mfPnq3Fixera9eu6tq1qxYvXqxmzZrpmmuu8XH3qI3L5dITTzyhqVOnqkmTb/7qc00D05gxY/SnP/1JqampSktL044dO3Tvvffq+uuvl8R1DWTr1q2TZVm66KKLtG/fPs2fP18XXXSRfv7zn3NdA4DT6dS+ffvcr/fv36+dO3cqPj5eqampZ71+sbGxmjZtmubNm6fWrVsrPj5emZmZ6tWrl4YMGeKrrxXyznZdjx8/rgMHDujIkSOS5P5FcmJiohITE7mu/sR3G83BX7388stWz549raioKKtbt27WI488Uq3ucrmsRYsWWYmJiVZUVJR16aWXWh988IGPusW5WrdunSXJ+uijj2rUuKaBp7S01Lr11lut1NRUq2nTplanTp2s22+/3SovL3efw3UNTM8++6zVqVMnKzIy0kpMTLRmzJhhnThxwl3nuvq3d955x5JU4zF16lTLss7t+pWVlVkzZ8604uPjrejoaGv06NHWgQMHfPBt8LWzXdcnnnjCY33RokXuz+C6+geHZVmW/ZELAAAAAOzFmh8AAAAAIYHwAwAAACAkEH4AAAAAhATCDwAAAICQQPgBAAAAEBIIPwAAAABCAuEHAAAAQEgg/AAAAAAICYQfAAAAACGB8AMAAAAgJBB+AAAAAIQEwg8AAACAkPD/cXi/g2fHhboAAAAASUVORK5CYII=",
      "text/plain": [
       "<Figure size 1000x600 with 1 Axes>"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    }
   ],
   "source": [
    "plt.figure(figsize=(10, 6))\n",
    "plt.scatter(x, y, color='blue', alpha=0.7, label='实际数据')\n",
    "plt.plot(x, y_pred, color='red', linewidth=2, label='回归线')"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 34,
   "id": "e591fcd7",
   "metadata": {},
   "outputs": [
    {
     "ename": "NameError",
     "evalue": "name 'r_squared' is not defined",
     "output_type": "error",
     "traceback": [
      "\u001b[1;31m---------------------------------------------------------------------------\u001b[0m",
      "\u001b[1;31mNameError\u001b[0m                                 Traceback (most recent call last)",
      "Cell \u001b[1;32mIn[34], line 1\u001b[0m\n\u001b[1;32m----> 1\u001b[0m equation_text \u001b[38;5;241m=\u001b[39m \u001b[38;5;124mf\u001b[39m\u001b[38;5;124m'\u001b[39m\u001b[38;5;124mŷ = \u001b[39m\u001b[38;5;132;01m{\u001b[39;00mbeta_0\u001b[38;5;132;01m:\u001b[39;00m\u001b[38;5;124m.2f\u001b[39m\u001b[38;5;132;01m}\u001b[39;00m\u001b[38;5;124m + \u001b[39m\u001b[38;5;132;01m{\u001b[39;00mbeta_1\u001b[38;5;132;01m:\u001b[39;00m\u001b[38;5;124m.2f\u001b[39m\u001b[38;5;132;01m}\u001b[39;00m\u001b[38;5;124mx\u001b[39m\u001b[38;5;130;01m\\n\u001b[39;00m\u001b[38;5;124mR² = \u001b[39m\u001b[38;5;132;01m{\u001b[39;00mr_squared\u001b[38;5;132;01m:\u001b[39;00m\u001b[38;5;124m.3f\u001b[39m\u001b[38;5;132;01m}\u001b[39;00m\u001b[38;5;130;01m\\n\u001b[39;00m\u001b[38;5;124mMSE = \u001b[39m\u001b[38;5;132;01m{\u001b[39;00mmse\u001b[38;5;132;01m:\u001b[39;00m\u001b[38;5;124m.2f\u001b[39m\u001b[38;5;132;01m}\u001b[39;00m\u001b[38;5;124m'\u001b[39m\n\u001b[0;32m      2\u001b[0m plt\u001b[38;5;241m.\u001b[39mtext(\u001b[38;5;241m0.05\u001b[39m, \u001b[38;5;241m0.95\u001b[39m, equation_text, transform\u001b[38;5;241m=\u001b[39mplt\u001b[38;5;241m.\u001b[39mgca()\u001b[38;5;241m.\u001b[39mtransAxes, \n\u001b[0;32m      3\u001b[0m          fontsize\u001b[38;5;241m=\u001b[39m\u001b[38;5;241m12\u001b[39m, verticalalignment\u001b[38;5;241m=\u001b[39m\u001b[38;5;124m'\u001b[39m\u001b[38;5;124mtop\u001b[39m\u001b[38;5;124m'\u001b[39m, bbox\u001b[38;5;241m=\u001b[39m\u001b[38;5;28mdict\u001b[39m(boxstyle\u001b[38;5;241m=\u001b[39m\u001b[38;5;124m'\u001b[39m\u001b[38;5;124mround\u001b[39m\u001b[38;5;124m'\u001b[39m, facecolor\u001b[38;5;241m=\u001b[39m\u001b[38;5;124m'\u001b[39m\u001b[38;5;124mwheat\u001b[39m\u001b[38;5;124m'\u001b[39m, alpha\u001b[38;5;241m=\u001b[39m\u001b[38;5;241m0.8\u001b[39m))\n\u001b[0;32m      5\u001b[0m plt\u001b[38;5;241m.\u001b[39mxlabel(\u001b[38;5;124m'\u001b[39m\u001b[38;5;124m体重 (kg)\u001b[39m\u001b[38;5;124m'\u001b[39m)\n",
      "\u001b[1;31mNameError\u001b[0m: name 'r_squared' is not defined"
     ]
    }
   ],
   "source": [
    "equation_text = f'ŷ = {beta_0:.2f} + {beta_1:.2f}x\\nR² = {r_squared:.3f}\\nMSE = {mse:.2f}'\n",
    "plt.text(0.05, 0.95, equation_text, transform=plt.gca().transAxes, \n",
    "         fontsize=12, verticalalignment='top', bbox=dict(boxstyle='round', facecolor='wheat', alpha=0.8))\n",
    "\n",
    "plt.xlabel('体重 (kg)')\n",
    "plt.ylabel('身高 (cm)')\n",
    "plt.title('体重与身高的线性回归分析')\n",
    "plt.legend()\n",
    "plt.grid(True, alpha=0.3)\n",
    "plt.tight_layout()\n",
    "plt.show()"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 1,
   "id": "6efa0431",
   "metadata": {},
   "outputs": [],
   "source": [
    "import numpy as np"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 2,
   "id": "621285ba",
   "metadata": {},
   "outputs": [
    {
     "ename": "ModuleNotFoundError",
     "evalue": "No module named 'sklearn'",
     "output_type": "error",
     "traceback": [
      "\u001b[1;31m---------------------------------------------------------------------------\u001b[0m",
      "\u001b[1;31mModuleNotFoundError\u001b[0m                       Traceback (most recent call last)",
      "Cell \u001b[1;32mIn[2], line 1\u001b[0m\n\u001b[1;32m----> 1\u001b[0m \u001b[38;5;28;01mfrom\u001b[39;00m \u001b[38;5;21;01msklearn\u001b[39;00m\u001b[38;5;21;01m.\u001b[39;00m\u001b[38;5;21;01mliner_model\u001b[39;00m \u001b[38;5;28;01mimport\u001b[39;00m LinearRegression\n",
      "\u001b[1;31mModuleNotFoundError\u001b[0m: No module named 'sklearn'"
     ]
    }
   ],
   "source": [
    "from sklearn.liner_model import LinearRegression"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 3,
   "id": "bab930f1",
   "metadata": {},
   "outputs": [
    {
     "ename": "ModuleNotFoundError",
     "evalue": "No module named 'sklearn'",
     "output_type": "error",
     "traceback": [
      "\u001b[1;31m---------------------------------------------------------------------------\u001b[0m",
      "\u001b[1;31mModuleNotFoundError\u001b[0m                       Traceback (most recent call last)",
      "Cell \u001b[1;32mIn[3], line 1\u001b[0m\n\u001b[1;32m----> 1\u001b[0m \u001b[38;5;28;01mfrom\u001b[39;00m \u001b[38;5;21;01msklearn\u001b[39;00m\u001b[38;5;21;01m.\u001b[39;00m\u001b[38;5;21;01mlinear_model\u001b[39;00m \u001b[38;5;28;01mimport\u001b[39;00m LinearRegression\n",
      "\u001b[1;31mModuleNotFoundError\u001b[0m: No module named 'sklearn'"
     ]
    }
   ],
   "source": [
    "from sklearn.linear_model import LinearRegression"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 1,
   "id": "b78643e4",
   "metadata": {},
   "outputs": [
    {
     "ename": "NameError",
     "evalue": "name 'np' is not defined",
     "output_type": "error",
     "traceback": [
      "\u001b[1;31m---------------------------------------------------------------------------\u001b[0m",
      "\u001b[1;31mNameError\u001b[0m                                 Traceback (most recent call last)",
      "Cell \u001b[1;32mIn[1], line 1\u001b[0m\n\u001b[1;32m----> 1\u001b[0m \u001b[43mnp\u001b[49m\u001b[38;5;241m.\u001b[39mones(\u001b[38;5;241m100\u001b[39m)\n",
      "\u001b[1;31mNameError\u001b[0m: name 'np' is not defined"
     ]
    }
   ],
   "source": [
    "np.ones(100)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 2,
   "id": "628ee02e",
   "metadata": {},
   "outputs": [],
   "source": [
    "import numpy as np"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 3,
   "id": "57f89328",
   "metadata": {
    "collapsed": true
   },
   "outputs": [
    {
     "data": {
      "text/plain": [
       "array([1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1.,\n",
       "       1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1.,\n",
       "       1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1.,\n",
       "       1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1.,\n",
       "       1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1.,\n",
       "       1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1.])"
      ]
     },
     "execution_count": 3,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "np.ones(100)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 4,
   "id": "edc2c5bc",
   "metadata": {},
   "outputs": [
    {
     "ename": "NameError",
     "evalue": "name 'n' is not defined",
     "output_type": "error",
     "traceback": [
      "\u001b[1;31m---------------------------------------------------------------------------\u001b[0m",
      "\u001b[1;31mNameError\u001b[0m                                 Traceback (most recent call last)",
      "Cell \u001b[1;32mIn[4], line 1\u001b[0m\n\u001b[1;32m----> 1\u001b[0m X \u001b[38;5;241m=\u001b[39m np\u001b[38;5;241m.\u001b[39mrandom\u001b[38;5;241m.\u001b[39mrandn(\u001b[43mn\u001b[49m,p)\n",
      "\u001b[1;31mNameError\u001b[0m: name 'n' is not defined"
     ]
    }
   ],
   "source": [
    "X = np.random.randn(n,p)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 5,
   "id": "c1772d65",
   "metadata": {},
   "outputs": [],
   "source": [
    "X = np.random.randn(100,3)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 6,
   "id": "5159ee54",
   "metadata": {
    "collapsed": true
   },
   "outputs": [
    {
     "data": {
      "text/plain": [
       "array([[ 2.11813125e+00,  3.44176638e-01,  2.91490200e-01],\n",
       "       [-8.67908764e-04,  2.07841507e+00, -5.69358780e-01],\n",
       "       [ 5.39208560e-01, -1.83676038e-01, -6.81570102e-01],\n",
       "       [ 5.78001153e-01, -5.05938138e-01, -8.94526836e-01],\n",
       "       [-1.28824018e+00,  7.14892061e-01,  1.09469596e-02],\n",
       "       [-8.24085493e-01,  8.65972824e-02, -9.01230993e-01],\n",
       "       [-1.00304126e+00,  1.03713156e+00, -1.26046596e+00],\n",
       "       [ 5.36193695e-02,  7.32993732e-01, -9.78353473e-01],\n",
       "       [ 1.14948557e+00,  1.68607297e+00,  1.28852602e+00],\n",
       "       [-6.92211490e-01,  4.62127405e-01, -2.01989634e+00],\n",
       "       [ 6.44516152e-01, -3.96919441e-01, -2.36266935e-01],\n",
       "       [ 6.92427544e-01, -7.46866896e-02, -3.28502297e-01],\n",
       "       [-2.32542481e+00, -1.00131935e-01, -1.97290935e+00],\n",
       "       [-7.70549610e-01,  1.64705321e-03,  9.63458862e-02],\n",
       "       [-8.82753284e-01,  1.13910715e+00,  2.00764937e-01],\n",
       "       [ 1.24577328e-01,  1.52179446e+00,  1.10990925e+00],\n",
       "       [-1.39174662e+00, -1.63669559e+00, -1.39030746e+00],\n",
       "       [-1.57542298e-01, -2.81179721e-01, -1.46708803e+00],\n",
       "       [ 1.70153569e+00,  8.57173405e-01,  5.78869289e-02],\n",
       "       [-1.60862495e-01, -9.72053985e-01, -7.70090817e-01],\n",
       "       [-5.66511058e-01,  1.03617293e+00,  3.98774609e-01],\n",
       "       [ 7.23927506e-01, -8.87679824e-01,  1.69049325e-01],\n",
       "       [ 8.64038532e-01,  9.68897212e-01,  7.81521784e-01],\n",
       "       [ 7.80742233e-01, -7.96263559e-01, -2.35051440e+00],\n",
       "       [ 5.40302297e-01, -1.56062443e+00,  6.03543337e-01],\n",
       "       [ 3.83446692e-01,  3.34284921e-01, -1.14798821e+00],\n",
       "       [-7.70488629e-04, -3.58173543e-02,  2.99234246e-01],\n",
       "       [ 1.87940209e+00,  6.73090153e-02,  7.83362269e-01],\n",
       "       [-9.99399286e-01,  1.47275967e+00, -3.10926084e-01],\n",
       "       [ 6.73158185e-01,  1.07426071e+00,  4.62658677e-01],\n",
       "       [ 6.40575861e-02, -1.16767440e+00, -5.96707732e-01],\n",
       "       [ 1.66076926e+00,  8.41277846e-02,  6.62302362e-01],\n",
       "       [-2.10941237e+00, -6.86941492e-01, -6.18469802e-01],\n",
       "       [ 7.08386862e-01, -2.78944776e+00, -2.53680280e+00],\n",
       "       [-3.53983875e-01, -3.98432513e-02, -1.09310252e+00],\n",
       "       [ 8.76620628e-01, -9.57215549e-01, -1.56332915e+00],\n",
       "       [ 1.15002714e+00,  6.07211037e-01,  1.64529851e+00],\n",
       "       [-3.91230862e-01, -7.63651444e-01,  1.51516451e+00],\n",
       "       [-4.53911526e-02,  1.13216512e+00,  4.02789813e-01],\n",
       "       [-1.59466835e+00,  1.08660738e+00,  2.78585263e+00],\n",
       "       [ 1.36411317e+00,  5.96727863e-01,  4.81330147e-01],\n",
       "       [ 1.02265750e+00, -1.33531591e+00, -9.69197942e-01],\n",
       "       [-4.22449688e-01, -1.67506728e-01, -1.36178335e+00],\n",
       "       [ 8.05291524e-01, -4.82556795e-01, -6.93357787e-01],\n",
       "       [ 1.95733479e+00,  9.75918078e-01,  1.30077756e+00],\n",
       "       [ 7.41803899e-01,  4.07707641e-01,  1.20574105e+00],\n",
       "       [ 1.61061564e+00,  3.21160990e-01,  3.94848983e-01],\n",
       "       [ 8.51970951e-01,  8.42215640e-01, -1.51686780e+00],\n",
       "       [ 1.67124844e+00, -1.72359415e-01,  1.10026292e+00],\n",
       "       [ 1.20211324e+00, -1.50579136e+00, -1.95043152e-02],\n",
       "       [-1.14366406e+00,  4.25950969e-01,  3.90890206e-01],\n",
       "       [-1.36693106e-02,  9.76576058e-01, -4.79644648e-01],\n",
       "       [-1.40146069e+00,  3.01324137e-01,  1.31917520e-01],\n",
       "       [ 5.34083611e-01,  9.80993585e-01, -1.58600570e+00],\n",
       "       [ 1.14493671e+00, -5.43974652e-01, -1.04116253e+00],\n",
       "       [ 1.03703487e+00,  5.12545472e-01, -3.20439744e-01],\n",
       "       [-5.09462061e-01, -9.25704160e-01, -1.74833510e+00],\n",
       "       [-8.74861740e-01, -1.61120850e+00, -5.65237405e-01],\n",
       "       [-1.37957328e-01,  1.91312210e+00,  1.32452532e+00],\n",
       "       [ 2.85014010e+00,  7.59860633e-01, -1.72392437e+00],\n",
       "       [ 1.13054300e+00,  9.99725442e-02, -3.53252724e-01],\n",
       "       [ 2.30809737e+00, -1.60169400e+00,  1.80623559e+00],\n",
       "       [ 1.46507277e-01,  1.40413422e-02, -3.45040317e-01],\n",
       "       [-9.68894757e-02, -2.21297753e-01, -2.14494697e+00],\n",
       "       [-9.55069748e-03,  8.85679934e-02, -1.01346091e+00],\n",
       "       [-3.27511538e-02, -5.86368258e-02,  1.12024587e+00],\n",
       "       [-5.63597408e-01,  7.52139100e-01,  1.67197673e+00],\n",
       "       [-2.09756984e-02,  6.09377087e-01, -4.10643072e-01],\n",
       "       [-8.91938855e-01, -4.88882700e-01,  4.20273250e-01],\n",
       "       [-1.69912207e-01,  2.60437028e-01,  3.95275280e-01],\n",
       "       [ 5.88224301e-01,  3.75993271e-01, -8.98995467e-01],\n",
       "       [ 1.59602730e+00, -7.86202150e-01,  1.41830392e+00],\n",
       "       [ 2.09812315e+00,  7.44257283e-01, -7.49613287e-02],\n",
       "       [ 2.38020717e-01,  3.25091159e-01, -8.58278329e-01],\n",
       "       [-1.50729287e-01, -1.78574949e+00, -3.82624408e-01],\n",
       "       [-6.22021550e-01,  5.21117965e-01,  4.64107465e-01],\n",
       "       [-5.18662079e-01,  5.55299439e-01,  7.63491978e-01],\n",
       "       [ 7.48487866e-01,  4.66068720e-01, -7.74455653e-01],\n",
       "       [ 4.77265333e-01, -8.02242676e-01,  6.80474257e-01],\n",
       "       [ 1.22082855e+00,  5.78615999e-01,  2.31964752e+00],\n",
       "       [ 1.52241414e-01,  8.03910361e-01, -1.19630410e-01],\n",
       "       [-1.07886016e+00, -6.98254079e-01,  3.04807752e-01],\n",
       "       [-8.37829325e-02, -9.71416936e-01,  1.28853460e+00],\n",
       "       [-1.68938151e-01, -4.93342379e-01,  2.40556242e-01],\n",
       "       [ 1.15345298e+00, -4.88862052e-01,  8.13320244e-01],\n",
       "       [ 6.87688023e-01, -2.17418259e-01, -5.49005694e-01],\n",
       "       [ 1.87119663e-01, -5.10085539e-01, -2.22501826e-01],\n",
       "       [-6.43670274e-01, -5.45464329e-01,  6.94004636e-01],\n",
       "       [ 2.04403740e+00, -3.05381303e-01, -1.05709209e+00],\n",
       "       [ 5.17804654e-01, -1.45227059e+00,  2.95082237e-01],\n",
       "       [ 8.63743637e-01,  1.24704230e+00,  2.78714357e+00],\n",
       "       [-3.59634943e-01, -1.41493547e+00, -8.19689280e-02],\n",
       "       [ 8.01106467e-01,  3.75633321e-02,  1.84194658e+00],\n",
       "       [ 1.08711531e+00,  2.55301542e-01, -1.65905049e+00],\n",
       "       [ 9.05924909e-01, -3.23073039e+00, -5.38864112e-01],\n",
       "       [ 2.31054398e-01,  5.71385683e-01,  4.51882225e-01],\n",
       "       [-1.20209979e+00,  3.45116659e-01, -1.10317564e-01],\n",
       "       [ 8.08402971e-02,  4.06337823e-01,  1.44039347e-02],\n",
       "       [ 5.45952654e-01,  1.06388569e+00, -1.25190221e+00],\n",
       "       [-2.74215310e+00,  1.24264749e+00, -3.23941295e-01]])"
      ]
     },
     "execution_count": 6,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "X"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 7,
   "id": "96a5b8d2",
   "metadata": {
    "collapsed": true
   },
   "outputs": [
    {
     "ename": "NameError",
     "evalue": "name 'n' is not defined",
     "output_type": "error",
     "traceback": [
      "\u001b[1;31m---------------------------------------------------------------------------\u001b[0m",
      "\u001b[1;31mNameError\u001b[0m                                 Traceback (most recent call last)",
      "Cell \u001b[1;32mIn[7], line 1\u001b[0m\n\u001b[1;32m----> 1\u001b[0m X_with_intercept \u001b[38;5;241m=\u001b[39m np\u001b[38;5;241m.\u001b[39mcolumn_stack([np\u001b[38;5;241m.\u001b[39mones(\u001b[43mn\u001b[49m),X])\n",
      "\u001b[1;31mNameError\u001b[0m: name 'n' is not defined"
     ]
    }
   ],
   "source": [
    "X_with_intercept = np.column_stack([np.ones(n),X])"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 8,
   "id": "00e5a7e5",
   "metadata": {},
   "outputs": [],
   "source": [
    "X_with_intercept = np.column_stack([np.ones(100),X])"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 9,
   "id": "c88cedd6",
   "metadata": {
    "collapsed": true
   },
   "outputs": [
    {
     "data": {
      "text/plain": [
       "array([[ 1.00000000e+00,  2.11813125e+00,  3.44176638e-01,\n",
       "         2.91490200e-01],\n",
       "       [ 1.00000000e+00, -8.67908764e-04,  2.07841507e+00,\n",
       "        -5.69358780e-01],\n",
       "       [ 1.00000000e+00,  5.39208560e-01, -1.83676038e-01,\n",
       "        -6.81570102e-01],\n",
       "       [ 1.00000000e+00,  5.78001153e-01, -5.05938138e-01,\n",
       "        -8.94526836e-01],\n",
       "       [ 1.00000000e+00, -1.28824018e+00,  7.14892061e-01,\n",
       "         1.09469596e-02],\n",
       "       [ 1.00000000e+00, -8.24085493e-01,  8.65972824e-02,\n",
       "        -9.01230993e-01],\n",
       "       [ 1.00000000e+00, -1.00304126e+00,  1.03713156e+00,\n",
       "        -1.26046596e+00],\n",
       "       [ 1.00000000e+00,  5.36193695e-02,  7.32993732e-01,\n",
       "        -9.78353473e-01],\n",
       "       [ 1.00000000e+00,  1.14948557e+00,  1.68607297e+00,\n",
       "         1.28852602e+00],\n",
       "       [ 1.00000000e+00, -6.92211490e-01,  4.62127405e-01,\n",
       "        -2.01989634e+00],\n",
       "       [ 1.00000000e+00,  6.44516152e-01, -3.96919441e-01,\n",
       "        -2.36266935e-01],\n",
       "       [ 1.00000000e+00,  6.92427544e-01, -7.46866896e-02,\n",
       "        -3.28502297e-01],\n",
       "       [ 1.00000000e+00, -2.32542481e+00, -1.00131935e-01,\n",
       "        -1.97290935e+00],\n",
       "       [ 1.00000000e+00, -7.70549610e-01,  1.64705321e-03,\n",
       "         9.63458862e-02],\n",
       "       [ 1.00000000e+00, -8.82753284e-01,  1.13910715e+00,\n",
       "         2.00764937e-01],\n",
       "       [ 1.00000000e+00,  1.24577328e-01,  1.52179446e+00,\n",
       "         1.10990925e+00],\n",
       "       [ 1.00000000e+00, -1.39174662e+00, -1.63669559e+00,\n",
       "        -1.39030746e+00],\n",
       "       [ 1.00000000e+00, -1.57542298e-01, -2.81179721e-01,\n",
       "        -1.46708803e+00],\n",
       "       [ 1.00000000e+00,  1.70153569e+00,  8.57173405e-01,\n",
       "         5.78869289e-02],\n",
       "       [ 1.00000000e+00, -1.60862495e-01, -9.72053985e-01,\n",
       "        -7.70090817e-01],\n",
       "       [ 1.00000000e+00, -5.66511058e-01,  1.03617293e+00,\n",
       "         3.98774609e-01],\n",
       "       [ 1.00000000e+00,  7.23927506e-01, -8.87679824e-01,\n",
       "         1.69049325e-01],\n",
       "       [ 1.00000000e+00,  8.64038532e-01,  9.68897212e-01,\n",
       "         7.81521784e-01],\n",
       "       [ 1.00000000e+00,  7.80742233e-01, -7.96263559e-01,\n",
       "        -2.35051440e+00],\n",
       "       [ 1.00000000e+00,  5.40302297e-01, -1.56062443e+00,\n",
       "         6.03543337e-01],\n",
       "       [ 1.00000000e+00,  3.83446692e-01,  3.34284921e-01,\n",
       "        -1.14798821e+00],\n",
       "       [ 1.00000000e+00, -7.70488629e-04, -3.58173543e-02,\n",
       "         2.99234246e-01],\n",
       "       [ 1.00000000e+00,  1.87940209e+00,  6.73090153e-02,\n",
       "         7.83362269e-01],\n",
       "       [ 1.00000000e+00, -9.99399286e-01,  1.47275967e+00,\n",
       "        -3.10926084e-01],\n",
       "       [ 1.00000000e+00,  6.73158185e-01,  1.07426071e+00,\n",
       "         4.62658677e-01],\n",
       "       [ 1.00000000e+00,  6.40575861e-02, -1.16767440e+00,\n",
       "        -5.96707732e-01],\n",
       "       [ 1.00000000e+00,  1.66076926e+00,  8.41277846e-02,\n",
       "         6.62302362e-01],\n",
       "       [ 1.00000000e+00, -2.10941237e+00, -6.86941492e-01,\n",
       "        -6.18469802e-01],\n",
       "       [ 1.00000000e+00,  7.08386862e-01, -2.78944776e+00,\n",
       "        -2.53680280e+00],\n",
       "       [ 1.00000000e+00, -3.53983875e-01, -3.98432513e-02,\n",
       "        -1.09310252e+00],\n",
       "       [ 1.00000000e+00,  8.76620628e-01, -9.57215549e-01,\n",
       "        -1.56332915e+00],\n",
       "       [ 1.00000000e+00,  1.15002714e+00,  6.07211037e-01,\n",
       "         1.64529851e+00],\n",
       "       [ 1.00000000e+00, -3.91230862e-01, -7.63651444e-01,\n",
       "         1.51516451e+00],\n",
       "       [ 1.00000000e+00, -4.53911526e-02,  1.13216512e+00,\n",
       "         4.02789813e-01],\n",
       "       [ 1.00000000e+00, -1.59466835e+00,  1.08660738e+00,\n",
       "         2.78585263e+00],\n",
       "       [ 1.00000000e+00,  1.36411317e+00,  5.96727863e-01,\n",
       "         4.81330147e-01],\n",
       "       [ 1.00000000e+00,  1.02265750e+00, -1.33531591e+00,\n",
       "        -9.69197942e-01],\n",
       "       [ 1.00000000e+00, -4.22449688e-01, -1.67506728e-01,\n",
       "        -1.36178335e+00],\n",
       "       [ 1.00000000e+00,  8.05291524e-01, -4.82556795e-01,\n",
       "        -6.93357787e-01],\n",
       "       [ 1.00000000e+00,  1.95733479e+00,  9.75918078e-01,\n",
       "         1.30077756e+00],\n",
       "       [ 1.00000000e+00,  7.41803899e-01,  4.07707641e-01,\n",
       "         1.20574105e+00],\n",
       "       [ 1.00000000e+00,  1.61061564e+00,  3.21160990e-01,\n",
       "         3.94848983e-01],\n",
       "       [ 1.00000000e+00,  8.51970951e-01,  8.42215640e-01,\n",
       "        -1.51686780e+00],\n",
       "       [ 1.00000000e+00,  1.67124844e+00, -1.72359415e-01,\n",
       "         1.10026292e+00],\n",
       "       [ 1.00000000e+00,  1.20211324e+00, -1.50579136e+00,\n",
       "        -1.95043152e-02],\n",
       "       [ 1.00000000e+00, -1.14366406e+00,  4.25950969e-01,\n",
       "         3.90890206e-01],\n",
       "       [ 1.00000000e+00, -1.36693106e-02,  9.76576058e-01,\n",
       "        -4.79644648e-01],\n",
       "       [ 1.00000000e+00, -1.40146069e+00,  3.01324137e-01,\n",
       "         1.31917520e-01],\n",
       "       [ 1.00000000e+00,  5.34083611e-01,  9.80993585e-01,\n",
       "        -1.58600570e+00],\n",
       "       [ 1.00000000e+00,  1.14493671e+00, -5.43974652e-01,\n",
       "        -1.04116253e+00],\n",
       "       [ 1.00000000e+00,  1.03703487e+00,  5.12545472e-01,\n",
       "        -3.20439744e-01],\n",
       "       [ 1.00000000e+00, -5.09462061e-01, -9.25704160e-01,\n",
       "        -1.74833510e+00],\n",
       "       [ 1.00000000e+00, -8.74861740e-01, -1.61120850e+00,\n",
       "        -5.65237405e-01],\n",
       "       [ 1.00000000e+00, -1.37957328e-01,  1.91312210e+00,\n",
       "         1.32452532e+00],\n",
       "       [ 1.00000000e+00,  2.85014010e+00,  7.59860633e-01,\n",
       "        -1.72392437e+00],\n",
       "       [ 1.00000000e+00,  1.13054300e+00,  9.99725442e-02,\n",
       "        -3.53252724e-01],\n",
       "       [ 1.00000000e+00,  2.30809737e+00, -1.60169400e+00,\n",
       "         1.80623559e+00],\n",
       "       [ 1.00000000e+00,  1.46507277e-01,  1.40413422e-02,\n",
       "        -3.45040317e-01],\n",
       "       [ 1.00000000e+00, -9.68894757e-02, -2.21297753e-01,\n",
       "        -2.14494697e+00],\n",
       "       [ 1.00000000e+00, -9.55069748e-03,  8.85679934e-02,\n",
       "        -1.01346091e+00],\n",
       "       [ 1.00000000e+00, -3.27511538e-02, -5.86368258e-02,\n",
       "         1.12024587e+00],\n",
       "       [ 1.00000000e+00, -5.63597408e-01,  7.52139100e-01,\n",
       "         1.67197673e+00],\n",
       "       [ 1.00000000e+00, -2.09756984e-02,  6.09377087e-01,\n",
       "        -4.10643072e-01],\n",
       "       [ 1.00000000e+00, -8.91938855e-01, -4.88882700e-01,\n",
       "         4.20273250e-01],\n",
       "       [ 1.00000000e+00, -1.69912207e-01,  2.60437028e-01,\n",
       "         3.95275280e-01],\n",
       "       [ 1.00000000e+00,  5.88224301e-01,  3.75993271e-01,\n",
       "        -8.98995467e-01],\n",
       "       [ 1.00000000e+00,  1.59602730e+00, -7.86202150e-01,\n",
       "         1.41830392e+00],\n",
       "       [ 1.00000000e+00,  2.09812315e+00,  7.44257283e-01,\n",
       "        -7.49613287e-02],\n",
       "       [ 1.00000000e+00,  2.38020717e-01,  3.25091159e-01,\n",
       "        -8.58278329e-01],\n",
       "       [ 1.00000000e+00, -1.50729287e-01, -1.78574949e+00,\n",
       "        -3.82624408e-01],\n",
       "       [ 1.00000000e+00, -6.22021550e-01,  5.21117965e-01,\n",
       "         4.64107465e-01],\n",
       "       [ 1.00000000e+00, -5.18662079e-01,  5.55299439e-01,\n",
       "         7.63491978e-01],\n",
       "       [ 1.00000000e+00,  7.48487866e-01,  4.66068720e-01,\n",
       "        -7.74455653e-01],\n",
       "       [ 1.00000000e+00,  4.77265333e-01, -8.02242676e-01,\n",
       "         6.80474257e-01],\n",
       "       [ 1.00000000e+00,  1.22082855e+00,  5.78615999e-01,\n",
       "         2.31964752e+00],\n",
       "       [ 1.00000000e+00,  1.52241414e-01,  8.03910361e-01,\n",
       "        -1.19630410e-01],\n",
       "       [ 1.00000000e+00, -1.07886016e+00, -6.98254079e-01,\n",
       "         3.04807752e-01],\n",
       "       [ 1.00000000e+00, -8.37829325e-02, -9.71416936e-01,\n",
       "         1.28853460e+00],\n",
       "       [ 1.00000000e+00, -1.68938151e-01, -4.93342379e-01,\n",
       "         2.40556242e-01],\n",
       "       [ 1.00000000e+00,  1.15345298e+00, -4.88862052e-01,\n",
       "         8.13320244e-01],\n",
       "       [ 1.00000000e+00,  6.87688023e-01, -2.17418259e-01,\n",
       "        -5.49005694e-01],\n",
       "       [ 1.00000000e+00,  1.87119663e-01, -5.10085539e-01,\n",
       "        -2.22501826e-01],\n",
       "       [ 1.00000000e+00, -6.43670274e-01, -5.45464329e-01,\n",
       "         6.94004636e-01],\n",
       "       [ 1.00000000e+00,  2.04403740e+00, -3.05381303e-01,\n",
       "        -1.05709209e+00],\n",
       "       [ 1.00000000e+00,  5.17804654e-01, -1.45227059e+00,\n",
       "         2.95082237e-01],\n",
       "       [ 1.00000000e+00,  8.63743637e-01,  1.24704230e+00,\n",
       "         2.78714357e+00],\n",
       "       [ 1.00000000e+00, -3.59634943e-01, -1.41493547e+00,\n",
       "        -8.19689280e-02],\n",
       "       [ 1.00000000e+00,  8.01106467e-01,  3.75633321e-02,\n",
       "         1.84194658e+00],\n",
       "       [ 1.00000000e+00,  1.08711531e+00,  2.55301542e-01,\n",
       "        -1.65905049e+00],\n",
       "       [ 1.00000000e+00,  9.05924909e-01, -3.23073039e+00,\n",
       "        -5.38864112e-01],\n",
       "       [ 1.00000000e+00,  2.31054398e-01,  5.71385683e-01,\n",
       "         4.51882225e-01],\n",
       "       [ 1.00000000e+00, -1.20209979e+00,  3.45116659e-01,\n",
       "        -1.10317564e-01],\n",
       "       [ 1.00000000e+00,  8.08402971e-02,  4.06337823e-01,\n",
       "         1.44039347e-02],\n",
       "       [ 1.00000000e+00,  5.45952654e-01,  1.06388569e+00,\n",
       "        -1.25190221e+00],\n",
       "       [ 1.00000000e+00, -2.74215310e+00,  1.24264749e+00,\n",
       "        -3.23941295e-01]])"
      ]
     },
     "execution_count": 9,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "X_with_intercept"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 10,
   "id": "442ae1bf",
   "metadata": {},
   "outputs": [],
   "source": [
    "true_beta = np.array([2, -1, 3, 1.5])"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 11,
   "id": "c11bbfd9",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "array([ 2. , -1. ,  3. ,  1.5])"
      ]
     },
     "execution_count": 11,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "true_beta"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 12,
   "id": "1bc34f39",
   "metadata": {
    "collapsed": true
   },
   "outputs": [
    {
     "data": {
      "text/plain": [
       "array([  1.35163397,   7.38207496,  -0.11259183,  -1.43760582,\n",
       "         5.4493368 ,   1.73203085,   4.22373701,   2.67783162,\n",
       "         7.84152238,   1.0487492 ,  -0.18967488,   0.59075894,\n",
       "         1.06566499,   2.9200096 ,   6.60122215,   8.10566993,\n",
       "        -3.60380135,  -0.88662891,   2.95681492,  -1.91043569,\n",
       "         6.27319175,  -1.13339299,   5.21493578,  -4.69530451,\n",
       "        -2.31686058,   0.89742576,   2.3421698 ,   1.49756836,\n",
       "         6.95128918,   5.24361195,  -2.46214237,   1.58506764,\n",
       "         1.12088319, -10.88193434,   0.59480034,  -4.093261  ,\n",
       "         5.13955374,   2.3730233 ,   6.04607124,  11.03326942,\n",
       "         3.14806564,  -4.48240213,  -0.12274553,  -1.29299859,\n",
       "         4.92158579,   4.2899306 ,   1.9451408 ,   1.39937427,\n",
       "         1.4620677 ,  -3.7487438 ,   5.00785227,   4.22393051,\n",
       "         4.50330938,   2.0298886 ,  -2.33860446,   2.01994193,\n",
       "        -2.89015307,  -2.80661987,   9.86411161,  -1.15644475,\n",
       "         0.63949555,  -2.40382597,   1.37805628,  -1.78442424,\n",
       "         0.75506331,   3.53720948,   7.32797981,   3.23314235,\n",
       "         2.05570063,   3.54413621,   1.19126231,   0.17282213,\n",
       "         2.02220671,   1.44983527,  -3.78045579,   4.88153664,\n",
       "         5.32979836,   1.48803481,   0.13671802,   5.99449073,\n",
       "         4.08004405,   1.44130955,   1.10233403,   1.04974538,\n",
       "         0.59994123,  -0.16345134,  -0.05112902,   2.04828424,\n",
       "        -2.54581944,  -2.43199308,   9.05809862,  -2.00812487,\n",
       "         4.0745034 ,  -0.80978641,  -9.40641226,   4.16092599,\n",
       "         4.07197342,   3.15977907,   2.76785109,   7.98418363])"
      ]
     },
     "execution_count": 12,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "X_with_intercept @ true_beta"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 13,
   "id": "d88c6c56",
   "metadata": {
    "collapsed": true
   },
   "outputs": [
    {
     "data": {
      "text/plain": [
       "array([[ 1.00000000e+00,  2.11813125e+00,  3.44176638e-01,\n",
       "         2.91490200e-01],\n",
       "       [ 1.00000000e+00, -8.67908764e-04,  2.07841507e+00,\n",
       "        -5.69358780e-01],\n",
       "       [ 1.00000000e+00,  5.39208560e-01, -1.83676038e-01,\n",
       "        -6.81570102e-01],\n",
       "       [ 1.00000000e+00,  5.78001153e-01, -5.05938138e-01,\n",
       "        -8.94526836e-01],\n",
       "       [ 1.00000000e+00, -1.28824018e+00,  7.14892061e-01,\n",
       "         1.09469596e-02],\n",
       "       [ 1.00000000e+00, -8.24085493e-01,  8.65972824e-02,\n",
       "        -9.01230993e-01],\n",
       "       [ 1.00000000e+00, -1.00304126e+00,  1.03713156e+00,\n",
       "        -1.26046596e+00],\n",
       "       [ 1.00000000e+00,  5.36193695e-02,  7.32993732e-01,\n",
       "        -9.78353473e-01],\n",
       "       [ 1.00000000e+00,  1.14948557e+00,  1.68607297e+00,\n",
       "         1.28852602e+00],\n",
       "       [ 1.00000000e+00, -6.92211490e-01,  4.62127405e-01,\n",
       "        -2.01989634e+00],\n",
       "       [ 1.00000000e+00,  6.44516152e-01, -3.96919441e-01,\n",
       "        -2.36266935e-01],\n",
       "       [ 1.00000000e+00,  6.92427544e-01, -7.46866896e-02,\n",
       "        -3.28502297e-01],\n",
       "       [ 1.00000000e+00, -2.32542481e+00, -1.00131935e-01,\n",
       "        -1.97290935e+00],\n",
       "       [ 1.00000000e+00, -7.70549610e-01,  1.64705321e-03,\n",
       "         9.63458862e-02],\n",
       "       [ 1.00000000e+00, -8.82753284e-01,  1.13910715e+00,\n",
       "         2.00764937e-01],\n",
       "       [ 1.00000000e+00,  1.24577328e-01,  1.52179446e+00,\n",
       "         1.10990925e+00],\n",
       "       [ 1.00000000e+00, -1.39174662e+00, -1.63669559e+00,\n",
       "        -1.39030746e+00],\n",
       "       [ 1.00000000e+00, -1.57542298e-01, -2.81179721e-01,\n",
       "        -1.46708803e+00],\n",
       "       [ 1.00000000e+00,  1.70153569e+00,  8.57173405e-01,\n",
       "         5.78869289e-02],\n",
       "       [ 1.00000000e+00, -1.60862495e-01, -9.72053985e-01,\n",
       "        -7.70090817e-01],\n",
       "       [ 1.00000000e+00, -5.66511058e-01,  1.03617293e+00,\n",
       "         3.98774609e-01],\n",
       "       [ 1.00000000e+00,  7.23927506e-01, -8.87679824e-01,\n",
       "         1.69049325e-01],\n",
       "       [ 1.00000000e+00,  8.64038532e-01,  9.68897212e-01,\n",
       "         7.81521784e-01],\n",
       "       [ 1.00000000e+00,  7.80742233e-01, -7.96263559e-01,\n",
       "        -2.35051440e+00],\n",
       "       [ 1.00000000e+00,  5.40302297e-01, -1.56062443e+00,\n",
       "         6.03543337e-01],\n",
       "       [ 1.00000000e+00,  3.83446692e-01,  3.34284921e-01,\n",
       "        -1.14798821e+00],\n",
       "       [ 1.00000000e+00, -7.70488629e-04, -3.58173543e-02,\n",
       "         2.99234246e-01],\n",
       "       [ 1.00000000e+00,  1.87940209e+00,  6.73090153e-02,\n",
       "         7.83362269e-01],\n",
       "       [ 1.00000000e+00, -9.99399286e-01,  1.47275967e+00,\n",
       "        -3.10926084e-01],\n",
       "       [ 1.00000000e+00,  6.73158185e-01,  1.07426071e+00,\n",
       "         4.62658677e-01],\n",
       "       [ 1.00000000e+00,  6.40575861e-02, -1.16767440e+00,\n",
       "        -5.96707732e-01],\n",
       "       [ 1.00000000e+00,  1.66076926e+00,  8.41277846e-02,\n",
       "         6.62302362e-01],\n",
       "       [ 1.00000000e+00, -2.10941237e+00, -6.86941492e-01,\n",
       "        -6.18469802e-01],\n",
       "       [ 1.00000000e+00,  7.08386862e-01, -2.78944776e+00,\n",
       "        -2.53680280e+00],\n",
       "       [ 1.00000000e+00, -3.53983875e-01, -3.98432513e-02,\n",
       "        -1.09310252e+00],\n",
       "       [ 1.00000000e+00,  8.76620628e-01, -9.57215549e-01,\n",
       "        -1.56332915e+00],\n",
       "       [ 1.00000000e+00,  1.15002714e+00,  6.07211037e-01,\n",
       "         1.64529851e+00],\n",
       "       [ 1.00000000e+00, -3.91230862e-01, -7.63651444e-01,\n",
       "         1.51516451e+00],\n",
       "       [ 1.00000000e+00, -4.53911526e-02,  1.13216512e+00,\n",
       "         4.02789813e-01],\n",
       "       [ 1.00000000e+00, -1.59466835e+00,  1.08660738e+00,\n",
       "         2.78585263e+00],\n",
       "       [ 1.00000000e+00,  1.36411317e+00,  5.96727863e-01,\n",
       "         4.81330147e-01],\n",
       "       [ 1.00000000e+00,  1.02265750e+00, -1.33531591e+00,\n",
       "        -9.69197942e-01],\n",
       "       [ 1.00000000e+00, -4.22449688e-01, -1.67506728e-01,\n",
       "        -1.36178335e+00],\n",
       "       [ 1.00000000e+00,  8.05291524e-01, -4.82556795e-01,\n",
       "        -6.93357787e-01],\n",
       "       [ 1.00000000e+00,  1.95733479e+00,  9.75918078e-01,\n",
       "         1.30077756e+00],\n",
       "       [ 1.00000000e+00,  7.41803899e-01,  4.07707641e-01,\n",
       "         1.20574105e+00],\n",
       "       [ 1.00000000e+00,  1.61061564e+00,  3.21160990e-01,\n",
       "         3.94848983e-01],\n",
       "       [ 1.00000000e+00,  8.51970951e-01,  8.42215640e-01,\n",
       "        -1.51686780e+00],\n",
       "       [ 1.00000000e+00,  1.67124844e+00, -1.72359415e-01,\n",
       "         1.10026292e+00],\n",
       "       [ 1.00000000e+00,  1.20211324e+00, -1.50579136e+00,\n",
       "        -1.95043152e-02],\n",
       "       [ 1.00000000e+00, -1.14366406e+00,  4.25950969e-01,\n",
       "         3.90890206e-01],\n",
       "       [ 1.00000000e+00, -1.36693106e-02,  9.76576058e-01,\n",
       "        -4.79644648e-01],\n",
       "       [ 1.00000000e+00, -1.40146069e+00,  3.01324137e-01,\n",
       "         1.31917520e-01],\n",
       "       [ 1.00000000e+00,  5.34083611e-01,  9.80993585e-01,\n",
       "        -1.58600570e+00],\n",
       "       [ 1.00000000e+00,  1.14493671e+00, -5.43974652e-01,\n",
       "        -1.04116253e+00],\n",
       "       [ 1.00000000e+00,  1.03703487e+00,  5.12545472e-01,\n",
       "        -3.20439744e-01],\n",
       "       [ 1.00000000e+00, -5.09462061e-01, -9.25704160e-01,\n",
       "        -1.74833510e+00],\n",
       "       [ 1.00000000e+00, -8.74861740e-01, -1.61120850e+00,\n",
       "        -5.65237405e-01],\n",
       "       [ 1.00000000e+00, -1.37957328e-01,  1.91312210e+00,\n",
       "         1.32452532e+00],\n",
       "       [ 1.00000000e+00,  2.85014010e+00,  7.59860633e-01,\n",
       "        -1.72392437e+00],\n",
       "       [ 1.00000000e+00,  1.13054300e+00,  9.99725442e-02,\n",
       "        -3.53252724e-01],\n",
       "       [ 1.00000000e+00,  2.30809737e+00, -1.60169400e+00,\n",
       "         1.80623559e+00],\n",
       "       [ 1.00000000e+00,  1.46507277e-01,  1.40413422e-02,\n",
       "        -3.45040317e-01],\n",
       "       [ 1.00000000e+00, -9.68894757e-02, -2.21297753e-01,\n",
       "        -2.14494697e+00],\n",
       "       [ 1.00000000e+00, -9.55069748e-03,  8.85679934e-02,\n",
       "        -1.01346091e+00],\n",
       "       [ 1.00000000e+00, -3.27511538e-02, -5.86368258e-02,\n",
       "         1.12024587e+00],\n",
       "       [ 1.00000000e+00, -5.63597408e-01,  7.52139100e-01,\n",
       "         1.67197673e+00],\n",
       "       [ 1.00000000e+00, -2.09756984e-02,  6.09377087e-01,\n",
       "        -4.10643072e-01],\n",
       "       [ 1.00000000e+00, -8.91938855e-01, -4.88882700e-01,\n",
       "         4.20273250e-01],\n",
       "       [ 1.00000000e+00, -1.69912207e-01,  2.60437028e-01,\n",
       "         3.95275280e-01],\n",
       "       [ 1.00000000e+00,  5.88224301e-01,  3.75993271e-01,\n",
       "        -8.98995467e-01],\n",
       "       [ 1.00000000e+00,  1.59602730e+00, -7.86202150e-01,\n",
       "         1.41830392e+00],\n",
       "       [ 1.00000000e+00,  2.09812315e+00,  7.44257283e-01,\n",
       "        -7.49613287e-02],\n",
       "       [ 1.00000000e+00,  2.38020717e-01,  3.25091159e-01,\n",
       "        -8.58278329e-01],\n",
       "       [ 1.00000000e+00, -1.50729287e-01, -1.78574949e+00,\n",
       "        -3.82624408e-01],\n",
       "       [ 1.00000000e+00, -6.22021550e-01,  5.21117965e-01,\n",
       "         4.64107465e-01],\n",
       "       [ 1.00000000e+00, -5.18662079e-01,  5.55299439e-01,\n",
       "         7.63491978e-01],\n",
       "       [ 1.00000000e+00,  7.48487866e-01,  4.66068720e-01,\n",
       "        -7.74455653e-01],\n",
       "       [ 1.00000000e+00,  4.77265333e-01, -8.02242676e-01,\n",
       "         6.80474257e-01],\n",
       "       [ 1.00000000e+00,  1.22082855e+00,  5.78615999e-01,\n",
       "         2.31964752e+00],\n",
       "       [ 1.00000000e+00,  1.52241414e-01,  8.03910361e-01,\n",
       "        -1.19630410e-01],\n",
       "       [ 1.00000000e+00, -1.07886016e+00, -6.98254079e-01,\n",
       "         3.04807752e-01],\n",
       "       [ 1.00000000e+00, -8.37829325e-02, -9.71416936e-01,\n",
       "         1.28853460e+00],\n",
       "       [ 1.00000000e+00, -1.68938151e-01, -4.93342379e-01,\n",
       "         2.40556242e-01],\n",
       "       [ 1.00000000e+00,  1.15345298e+00, -4.88862052e-01,\n",
       "         8.13320244e-01],\n",
       "       [ 1.00000000e+00,  6.87688023e-01, -2.17418259e-01,\n",
       "        -5.49005694e-01],\n",
       "       [ 1.00000000e+00,  1.87119663e-01, -5.10085539e-01,\n",
       "        -2.22501826e-01],\n",
       "       [ 1.00000000e+00, -6.43670274e-01, -5.45464329e-01,\n",
       "         6.94004636e-01],\n",
       "       [ 1.00000000e+00,  2.04403740e+00, -3.05381303e-01,\n",
       "        -1.05709209e+00],\n",
       "       [ 1.00000000e+00,  5.17804654e-01, -1.45227059e+00,\n",
       "         2.95082237e-01],\n",
       "       [ 1.00000000e+00,  8.63743637e-01,  1.24704230e+00,\n",
       "         2.78714357e+00],\n",
       "       [ 1.00000000e+00, -3.59634943e-01, -1.41493547e+00,\n",
       "        -8.19689280e-02],\n",
       "       [ 1.00000000e+00,  8.01106467e-01,  3.75633321e-02,\n",
       "         1.84194658e+00],\n",
       "       [ 1.00000000e+00,  1.08711531e+00,  2.55301542e-01,\n",
       "        -1.65905049e+00],\n",
       "       [ 1.00000000e+00,  9.05924909e-01, -3.23073039e+00,\n",
       "        -5.38864112e-01],\n",
       "       [ 1.00000000e+00,  2.31054398e-01,  5.71385683e-01,\n",
       "         4.51882225e-01],\n",
       "       [ 1.00000000e+00, -1.20209979e+00,  3.45116659e-01,\n",
       "        -1.10317564e-01],\n",
       "       [ 1.00000000e+00,  8.08402971e-02,  4.06337823e-01,\n",
       "         1.44039347e-02],\n",
       "       [ 1.00000000e+00,  5.45952654e-01,  1.06388569e+00,\n",
       "        -1.25190221e+00],\n",
       "       [ 1.00000000e+00, -2.74215310e+00,  1.24264749e+00,\n",
       "        -3.23941295e-01]])"
      ]
     },
     "execution_count": 13,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "X_with_intercept"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 14,
   "id": "49213c6c",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "array([ 2. , -1. ,  3. ,  1.5])"
      ]
     },
     "execution_count": 14,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "true_beta"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 15,
   "id": "7866812e",
   "metadata": {},
   "outputs": [],
   "source": [
    "X = np.random.randn(3,3)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 16,
   "id": "8313698c",
   "metadata": {},
   "outputs": [],
   "source": [
    "X_with_intercept = np.column_stack([np.ones(3),X])"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 17,
   "id": "534217a5",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "array([[ 1.        ,  0.68159195,  0.04244371, -0.55078409],\n",
       "       [ 1.        , -0.63400705,  1.26047545,  1.37546572],\n",
       "       [ 1.        ,  1.9623259 ,  0.84026271,  0.46431594]])"
      ]
     },
     "execution_count": 17,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "X_with_intercept"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 18,
   "id": "b4530bb6",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "array([0.61956303, 8.47863198, 3.25493615])"
      ]
     },
     "execution_count": 18,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "X_with_intercept @ true_beta"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 1,
   "id": "cbf4c0fa",
   "metadata": {},
   "outputs": [
    {
     "ename": "NameError",
     "evalue": "name 'x' is not defined",
     "output_type": "error",
     "traceback": [
      "\u001b[1;31m---------------------------------------------------------------------------\u001b[0m",
      "\u001b[1;31mNameError\u001b[0m                                 Traceback (most recent call last)",
      "Cell \u001b[1;32mIn[1], line 1\u001b[0m\n\u001b[1;32m----> 1\u001b[0m \u001b[43mx\u001b[49m\n",
      "\u001b[1;31mNameError\u001b[0m: name 'x' is not defined"
     ]
    }
   ],
   "source": [
    "x"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 2,
   "id": "98e4dbab",
   "metadata": {},
   "outputs": [
    {
     "ename": "NameError",
     "evalue": "name 'np' is not defined",
     "output_type": "error",
     "traceback": [
      "\u001b[1;31m---------------------------------------------------------------------------\u001b[0m",
      "\u001b[1;31mNameError\u001b[0m                                 Traceback (most recent call last)",
      "Cell \u001b[1;32mIn[2], line 1\u001b[0m\n\u001b[1;32m----> 1\u001b[0m data \u001b[38;5;241m=\u001b[39m \u001b[43mnp\u001b[49m\u001b[38;5;241m.\u001b[39mrandom\u001b[38;5;241m.\u001b[39mrandn(\u001b[38;5;241m5\u001b[39m)\n",
      "\u001b[1;31mNameError\u001b[0m: name 'np' is not defined"
     ]
    }
   ],
   "source": [
    "data = np.random.randn(5)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 3,
   "id": "7acf07f9",
   "metadata": {},
   "outputs": [],
   "source": [
    "import numpy as np"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 4,
   "id": "8cb9160f",
   "metadata": {},
   "outputs": [],
   "source": [
    "data = np.random.randn(5)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 5,
   "id": "710aaae9",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "array([-0.99417184,  0.02669098, -0.2513695 , -0.06110542, -0.37599635])"
      ]
     },
     "execution_count": 5,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "data"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 6,
   "id": "02a3a663",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "(5,)"
      ]
     },
     "execution_count": 6,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "data.shape"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 7,
   "id": "83e9fb9d",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "dtype('float64')"
      ]
     },
     "execution_count": 7,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "data.dtype"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 8,
   "id": "7e32ee33",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "array([-0.99417184,  0.02669098, -0.2513695 , -0.06110542, -0.37599635])"
      ]
     },
     "execution_count": 8,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "data.T"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 9,
   "id": "5de6c376",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "array([-0.99417184,  0.02669098, -0.2513695 , -0.06110542, -0.37599635])"
      ]
     },
     "execution_count": 9,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "data"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 10,
   "id": "f8b3713a",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "<function ndarray.transpose>"
      ]
     },
     "execution_count": 10,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "data.transpose"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 11,
   "id": "aead1ffd",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "array([-0.99417184,  0.02669098, -0.2513695 , -0.06110542, -0.37599635])"
      ]
     },
     "execution_count": 11,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "data.transpose()"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 12,
   "id": "38986fdd",
   "metadata": {},
   "outputs": [
    {
     "ename": "NameError",
     "evalue": "name 'array' is not defined",
     "output_type": "error",
     "traceback": [
      "\u001b[1;31m---------------------------------------------------------------------------\u001b[0m",
      "\u001b[1;31mNameError\u001b[0m                                 Traceback (most recent call last)",
      "Cell \u001b[1;32mIn[12], line 1\u001b[0m\n\u001b[1;32m----> 1\u001b[0m v1 \u001b[38;5;241m=\u001b[39m \u001b[43marray\u001b[49m([\u001b[38;5;241m0\u001b[39m, \u001b[38;5;241m0\u001b[39m, \u001b[38;5;241m0\u001b[39m])\n\u001b[0;32m      2\u001b[0m v1t \u001b[38;5;241m=\u001b[39m v1\u001b[38;5;241m.\u001b[39mtranspose()\n\u001b[0;32m      3\u001b[0m \u001b[38;5;28mprint\u001b[39m(v1)\n",
      "\u001b[1;31mNameError\u001b[0m: name 'array' is not defined"
     ]
    }
   ],
   "source": [
    "v1 = array([0, 0, 0])\n",
    "v1t = v1.transpose()\n",
    "print(v1)\n",
    "print(v1t)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 13,
   "id": "184f4787",
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "[0 0 0]\n",
      "[0 0 0]\n"
     ]
    }
   ],
   "source": [
    "from numpy import *\n",
    " \n",
    "v1 = array([0, 0, 0])\n",
    "v1t = v1.transpose()\n",
    "print(v1)\n",
    "print(v1t)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 14,
   "id": "4ec7795a",
   "metadata": {},
   "outputs": [],
   "source": [
    "row_vector = np.array([1, 2, 3, 4])"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 15,
   "id": "eb1538be",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "array([1, 2, 3, 4])"
      ]
     },
     "execution_count": 15,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "row_vector"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 16,
   "id": "490f0712",
   "metadata": {},
   "outputs": [],
   "source": [
    "col_vector = row_vector.reshape(-1, 1)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 17,
   "id": "10b4ddfd",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "array([[1],\n",
       "       [2],\n",
       "       [3],\n",
       "       [4]])"
      ]
     },
     "execution_count": 17,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "col_vector"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 18,
   "id": "5e67d458",
   "metadata": {},
   "outputs": [],
   "source": [
    "col_vector = row_vector.T"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 19,
   "id": "893b58f8",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "array([1, 2, 3, 4])"
      ]
     },
     "execution_count": 19,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "col_vector"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 20,
   "id": "7db5079f",
   "metadata": {},
   "outputs": [
    {
     "ename": "ValueError",
     "evalue": "cannot reshape array of size 4 into shape (2,)",
     "output_type": "error",
     "traceback": [
      "\u001b[1;31m---------------------------------------------------------------------------\u001b[0m",
      "\u001b[1;31mValueError\u001b[0m                                Traceback (most recent call last)",
      "Cell \u001b[1;32mIn[20], line 1\u001b[0m\n\u001b[1;32m----> 1\u001b[0m \u001b[43mrow_vector\u001b[49m\u001b[38;5;241;43m.\u001b[39;49m\u001b[43mreshape\u001b[49m\u001b[43m(\u001b[49m\u001b[38;5;241;43m2\u001b[39;49m\u001b[43m)\u001b[49m\n",
      "\u001b[1;31mValueError\u001b[0m: cannot reshape array of size 4 into shape (2,)"
     ]
    }
   ],
   "source": [
    "row_vector.reshape(2)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 21,
   "id": "e0170413",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "array([[1, 2, 3, 4]])"
      ]
     },
     "execution_count": 21,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "row_vector.reshape(1,-1)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 22,
   "id": "75e39163",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "array([[1],\n",
       "       [2],\n",
       "       [3],\n",
       "       [4]])"
      ]
     },
     "execution_count": 22,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "row_vector.reshape(1,-1).T"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 23,
   "id": "125f9d48",
   "metadata": {},
   "outputs": [
    {
     "ename": "SyntaxError",
     "evalue": "invalid syntax (4202999330.py, line 1)",
     "output_type": "error",
     "traceback": [
      "\u001b[1;36m  Cell \u001b[1;32mIn[23], line 1\u001b[1;36m\u001b[0m\n\u001b[1;33m    data = np.array([1.2.3]).T\u001b[0m\n\u001b[1;37m                        ^\u001b[0m\n\u001b[1;31mSyntaxError\u001b[0m\u001b[1;31m:\u001b[0m invalid syntax\n"
     ]
    }
   ],
   "source": [
    "data = np.array([1.2.3]).T"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 24,
   "id": "3e938d2c",
   "metadata": {},
   "outputs": [
    {
     "ename": "SyntaxError",
     "evalue": "invalid syntax (251019858.py, line 1)",
     "output_type": "error",
     "traceback": [
      "\u001b[1;36m  Cell \u001b[1;32mIn[24], line 1\u001b[1;36m\u001b[0m\n\u001b[1;33m    data = np.array([1.2.3])\u001b[0m\n\u001b[1;37m                        ^\u001b[0m\n\u001b[1;31mSyntaxError\u001b[0m\u001b[1;31m:\u001b[0m invalid syntax\n"
     ]
    }
   ],
   "source": [
    "data = np.array([1.2.3])"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 25,
   "id": "6f12d5f6",
   "metadata": {},
   "outputs": [],
   "source": [
    "data = np.array([1,2,3]).T"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 26,
   "id": "59c10aa2",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "array([1, 2, 3])"
      ]
     },
     "execution_count": 26,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "data"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 27,
   "id": "0aeee95f",
   "metadata": {},
   "outputs": [],
   "source": [
    "data = np.array([[1,2,3]]).T"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 28,
   "id": "ff649b07",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "array([[1],\n",
       "       [2],\n",
       "       [3]])"
      ]
     },
     "execution_count": 28,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "data"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 29,
   "id": "6984194e",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "array([[1],\n",
       "       [2],\n",
       "       [3]])"
      ]
     },
     "execution_count": 29,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "data"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 30,
   "id": "b3663052",
   "metadata": {},
   "outputs": [],
   "source": [
    "data1 = np.random.randn(3,4)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 31,
   "id": "de174f23",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "array([[-0.18113714,  0.02705719, -0.3385322 , -0.90556422],\n",
       "       [-1.26410969, -0.99455306, -0.96042049,  0.99684787],\n",
       "       [-0.99405372, -1.00055518, -0.5458166 ,  0.71557085]])"
      ]
     },
     "execution_count": 31,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "data1"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 32,
   "id": "95391d51",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "array([[-0.18113714,  0.02705719, -0.3385322 , -0.90556422],\n",
       "       [-2.52821938, -1.98910613, -1.92084098,  1.99369574],\n",
       "       [-2.98216115, -3.00166553, -1.6374498 ,  2.14671254]])"
      ]
     },
     "execution_count": 32,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "data1 * data"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 33,
   "id": "635d348c",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "array([[-0.18113714,  0.02705719, -0.3385322 , -0.90556422],\n",
       "       [-2.52821938, -1.98910613, -1.92084098,  1.99369574],\n",
       "       [-2.98216115, -3.00166553, -1.6374498 ,  2.14671254]])"
      ]
     },
     "execution_count": 33,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "data * data1"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 34,
   "id": "968acc72",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "array([[1],\n",
       "       [2],\n",
       "       [3]])"
      ]
     },
     "execution_count": 34,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "data"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 35,
   "id": "ddcaf718",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "array([[-0.18113714,  0.02705719, -0.3385322 , -0.90556422],\n",
       "       [-1.26410969, -0.99455306, -0.96042049,  0.99684787],\n",
       "       [-0.99405372, -1.00055518, -0.5458166 ,  0.71557085]])"
      ]
     },
     "execution_count": 35,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "data1"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 36,
   "id": "cfc3aa61",
   "metadata": {},
   "outputs": [],
   "source": [
    "data1 = np.random.rand(3,3)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 37,
   "id": "26ad0fe0",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "array([[0.8395074 , 0.19906799, 0.67675366],\n",
       "       [0.55297516, 0.10785236, 0.56804833],\n",
       "       [0.84725578, 0.02028583, 0.7007737 ]])"
      ]
     },
     "execution_count": 37,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "data1"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 38,
   "id": "178354f9",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "array([[0.8395074 , 0.19906799, 0.67675366],\n",
       "       [1.10595032, 0.21570471, 1.13609666],\n",
       "       [2.54176733, 0.0608575 , 2.10232111]])"
      ]
     },
     "execution_count": 38,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "data1 * data"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 39,
   "id": "f39b57aa",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "array([[3.26790435],\n",
       "       [2.47282487],\n",
       "       [2.99014855]])"
      ]
     },
     "execution_count": 39,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "data1 @ data"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 40,
   "id": "b1756ac1",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "array([[0.8395074 , 0.19906799, 0.67675366],\n",
       "       [0.55297516, 0.10785236, 0.56804833],\n",
       "       [0.84725578, 0.02028583, 0.7007737 ]])"
      ]
     },
     "execution_count": 40,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "data1"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 41,
   "id": "fad54fec",
   "metadata": {},
   "outputs": [
    {
     "ename": "ValueError",
     "evalue": "matmul: Input operand 1 has a mismatch in its core dimension 0, with gufunc signature (n?,k),(k,m?)->(n?,m?) (size 3 is different from 1)",
     "output_type": "error",
     "traceback": [
      "\u001b[1;31m---------------------------------------------------------------------------\u001b[0m",
      "\u001b[1;31mValueError\u001b[0m                                Traceback (most recent call last)",
      "Cell \u001b[1;32mIn[41], line 1\u001b[0m\n\u001b[1;32m----> 1\u001b[0m \u001b[43mdata\u001b[49m\u001b[43m \u001b[49m\u001b[38;5;241;43m@\u001b[39;49m\u001b[43m \u001b[49m\u001b[43mdata1\u001b[49m\n",
      "\u001b[1;31mValueError\u001b[0m: matmul: Input operand 1 has a mismatch in its core dimension 0, with gufunc signature (n?,k),(k,m?)->(n?,m?) (size 3 is different from 1)"
     ]
    }
   ],
   "source": [
    "data @ data1"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 42,
   "id": "c467817f",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "array([[0.8395074 , 0.19906799, 0.67675366],\n",
       "       [0.55297516, 0.10785236, 0.56804833],\n",
       "       [0.84725578, 0.02028583, 0.7007737 ]])"
      ]
     },
     "execution_count": 42,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "data1"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 43,
   "id": "eb83d5d7",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "array([[1],\n",
       "       [2],\n",
       "       [3]])"
      ]
     },
     "execution_count": 43,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "data"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 44,
   "id": "1f40f904",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "array([[3.26790435],\n",
       "       [2.47282487],\n",
       "       [2.99014855]])"
      ]
     },
     "execution_count": 44,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "data1 @ data"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 45,
   "id": "f4c48594",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "array([[0.8395074 , 0.19906799, 0.67675366],\n",
       "       [0.55297516, 0.10785236, 0.56804833],\n",
       "       [0.84725578, 0.02028583, 0.7007737 ]])"
      ]
     },
     "execution_count": 45,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "data1"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 46,
   "id": "005a8274",
   "metadata": {},
   "outputs": [],
   "source": [
    "a = np.array([[1,2],[3,4]])"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 47,
   "id": "41a471ea",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "array([[1, 2],\n",
       "       [3, 4]])"
      ]
     },
     "execution_count": 47,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "a"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 48,
   "id": "6a282cfe",
   "metadata": {},
   "outputs": [],
   "source": [
    "a = np.array([[1,2],[3,4]],dtype=\"float\")"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 49,
   "id": "01b44540",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "array([[1., 2.],\n",
       "       [3., 4.]])"
      ]
     },
     "execution_count": 49,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "a"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 50,
   "id": "ff2e2316",
   "metadata": {},
   "outputs": [],
   "source": [
    "ainv = np.linalg.inv(a)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 51,
   "id": "a250a1da",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "array([[-2. ,  1. ],\n",
       "       [ 1.5, -0.5]])"
      ]
     },
     "execution_count": 51,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "ainv"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 52,
   "id": "fdfbac12",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "array([[1., 3.],\n",
       "       [2., 4.]])"
      ]
     },
     "execution_count": 52,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "a.T"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 53,
   "id": "8ee6a6a2",
   "metadata": {},
   "outputs": [],
   "source": [
    "data2 = np.random.randn(3,4)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 54,
   "id": "86dd9e64",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "array([[ 0.38640717,  1.95189196, -0.92906719, -0.16167862],\n",
       "       [ 0.81662743, -0.36028006,  0.25893866, -0.75233057],\n",
       "       [ 1.2332689 , -1.65028998, -0.29993661,  0.73224265]])"
      ]
     },
     "execution_count": 54,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "data2"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 55,
   "id": "2b5184b0",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "array([[ 0.38640717,  0.81662743,  1.2332689 ],\n",
       "       [ 1.95189196, -0.36028006, -1.65028998],\n",
       "       [-0.92906719,  0.25893866, -0.29993661],\n",
       "       [-0.16167862, -0.75233057,  0.73224265]])"
      ]
     },
     "execution_count": 55,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "data2.T"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 56,
   "id": "9b8ac106",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "array([[ 2.33714304, -1.57524083, -0.5174443 ,  0.22620453],\n",
       "       [-1.57524083,  6.66314098, -1.41174683, -1.25294221],\n",
       "       [-0.5174443 , -1.41174683,  1.02017704, -0.26422355],\n",
       "       [ 0.22620453, -1.25294221, -0.26422355,  1.12832056]])"
      ]
     },
     "execution_count": 56,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "data2.T.dot(data2)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 57,
   "id": "0294488e",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "array([[ 4.84849855, -0.5066127 , -2.58437052],\n",
       "       [-0.5066127 ,  1.4297326 ,  0.97313407],\n",
       "       [-2.58437052,  0.97313407,  4.87055046]])"
      ]
     },
     "execution_count": 57,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "data2.dot(data2.T)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 58,
   "id": "3dd6de26",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "array([[ 0.38640717,  1.95189196, -0.92906719, -0.16167862],\n",
       "       [ 0.81662743, -0.36028006,  0.25893866, -0.75233057],\n",
       "       [ 1.2332689 , -1.65028998, -0.29993661,  0.73224265]])"
      ]
     },
     "execution_count": 58,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "data2"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 59,
   "id": "eb981f96",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "array([[ 0.38640717,  0.81662743,  1.2332689 ],\n",
       "       [ 1.95189196, -0.36028006, -1.65028998],\n",
       "       [-0.92906719,  0.25893866, -0.29993661],\n",
       "       [-0.16167862, -0.75233057,  0.73224265]])"
      ]
     },
     "execution_count": 59,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "data2.T"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 60,
   "id": "4fe142f6",
   "metadata": {},
   "outputs": [
    {
     "ename": "TypeError",
     "evalue": "'tuple' object is not callable",
     "output_type": "error",
     "traceback": [
      "\u001b[1;31m---------------------------------------------------------------------------\u001b[0m",
      "\u001b[1;31mTypeError\u001b[0m                                 Traceback (most recent call last)",
      "Cell \u001b[1;32mIn[60], line 1\u001b[0m\n\u001b[1;32m----> 1\u001b[0m \u001b[43mdata2\u001b[49m\u001b[38;5;241;43m.\u001b[39;49m\u001b[43mshape\u001b[49m\u001b[43m(\u001b[49m\u001b[43m)\u001b[49m\n",
      "\u001b[1;31mTypeError\u001b[0m: 'tuple' object is not callable"
     ]
    }
   ],
   "source": [
    "data2.shape()"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 61,
   "id": "e718870f",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "(3, 1)"
      ]
     },
     "execution_count": 61,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "data.shape"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 62,
   "id": "938d261a",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "(3, 4)"
      ]
     },
     "execution_count": 62,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "data2.shape"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 63,
   "id": "bafb3c67",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "array([[ 0.38640717,  1.95189196, -0.92906719, -0.16167862],\n",
       "       [ 0.81662743, -0.36028006,  0.25893866, -0.75233057],\n",
       "       [ 1.2332689 , -1.65028998, -0.29993661,  0.73224265]])"
      ]
     },
     "execution_count": 63,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "data2"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 64,
   "id": "445995da",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "array([[ 0.38640717,  0.81662743,  1.2332689 ],\n",
       "       [ 1.95189196, -0.36028006, -1.65028998],\n",
       "       [-0.92906719,  0.25893866, -0.29993661],\n",
       "       [-0.16167862, -0.75233057,  0.73224265]])"
      ]
     },
     "execution_count": 64,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "data2.T"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 65,
   "id": "ef4b282f",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "array([[ 2.33714304, -1.57524083, -0.5174443 ,  0.22620453],\n",
       "       [-1.57524083,  6.66314098, -1.41174683, -1.25294221],\n",
       "       [-0.5174443 , -1.41174683,  1.02017704, -0.26422355],\n",
       "       [ 0.22620453, -1.25294221, -0.26422355,  1.12832056]])"
      ]
     },
     "execution_count": 65,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "data2.T.dot(data2)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 66,
   "id": "0b4a7912",
   "metadata": {},
   "outputs": [
    {
     "ename": "NameError",
     "evalue": "name 'df' is not defined",
     "output_type": "error",
     "traceback": [
      "\u001b[1;31m---------------------------------------------------------------------------\u001b[0m",
      "\u001b[1;31mNameError\u001b[0m                                 Traceback (most recent call last)",
      "Cell \u001b[1;32mIn[66], line 1\u001b[0m\n\u001b[1;32m----> 1\u001b[0m data_3 \u001b[38;5;241m=\u001b[39m \u001b[43mdf\u001b[49m\u001b[38;5;241m.\u001b[39mread_csv(\u001b[38;5;124m\"\u001b[39m\u001b[38;5;124mexamples/3.1-table.csv\u001b[39m\u001b[38;5;124m\"\u001b[39m)\n",
      "\u001b[1;31mNameError\u001b[0m: name 'df' is not defined"
     ]
    }
   ],
   "source": [
    "data_3 = df.read_csv(\"examples/3.1-table.csv\")"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 67,
   "id": "b0a3a374",
   "metadata": {},
   "outputs": [
    {
     "ename": "ModuleNotFoundError",
     "evalue": "No module named 'dataframe'",
     "output_type": "error",
     "traceback": [
      "\u001b[1;31m---------------------------------------------------------------------------\u001b[0m",
      "\u001b[1;31mModuleNotFoundError\u001b[0m                       Traceback (most recent call last)",
      "Cell \u001b[1;32mIn[67], line 1\u001b[0m\n\u001b[1;32m----> 1\u001b[0m \u001b[38;5;28;01mimport\u001b[39;00m \u001b[38;5;21;01mdataframe\u001b[39;00m \u001b[38;5;28;01mas\u001b[39;00m \u001b[38;5;21;01mdf\u001b[39;00m\n",
      "\u001b[1;31mModuleNotFoundError\u001b[0m: No module named 'dataframe'"
     ]
    }
   ],
   "source": [
    "import dataframe as df"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 68,
   "id": "1d3179bb",
   "metadata": {},
   "outputs": [],
   "source": [
    "import pandas as pd"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 69,
   "id": "399a0e45",
   "metadata": {},
   "outputs": [
    {
     "ename": "AttributeError",
     "evalue": "type object 'DataFrame' has no attribute 'read_csv'",
     "output_type": "error",
     "traceback": [
      "\u001b[1;31m---------------------------------------------------------------------------\u001b[0m",
      "\u001b[1;31mAttributeError\u001b[0m                            Traceback (most recent call last)",
      "Cell \u001b[1;32mIn[69], line 1\u001b[0m\n\u001b[1;32m----> 1\u001b[0m data_3 \u001b[38;5;241m=\u001b[39m \u001b[43mpd\u001b[49m\u001b[38;5;241;43m.\u001b[39;49m\u001b[43mDataFrame\u001b[49m\u001b[38;5;241;43m.\u001b[39;49m\u001b[43mread_csv\u001b[49m(\u001b[38;5;124m\"\u001b[39m\u001b[38;5;124m/examples/3.1-table.csv\u001b[39m\u001b[38;5;124m\"\u001b[39m)\n",
      "\u001b[1;31mAttributeError\u001b[0m: type object 'DataFrame' has no attribute 'read_csv'"
     ]
    }
   ],
   "source": [
    "data_3 = pd.DataFrame.read_csv(\"/examples/3.1-table.csv\")"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 70,
   "id": "aacc30ab",
   "metadata": {
    "collapsed": true
   },
   "outputs": [
    {
     "ename": "FileNotFoundError",
     "evalue": "[Errno 2] No such file or directory: '/examples/3.1-table.csv'",
     "output_type": "error",
     "traceback": [
      "\u001b[1;31m---------------------------------------------------------------------------\u001b[0m",
      "\u001b[1;31mFileNotFoundError\u001b[0m                         Traceback (most recent call last)",
      "Cell \u001b[1;32mIn[70], line 1\u001b[0m\n\u001b[1;32m----> 1\u001b[0m data_3 \u001b[38;5;241m=\u001b[39m \u001b[43mpd\u001b[49m\u001b[38;5;241;43m.\u001b[39;49m\u001b[43mread_csv\u001b[49m\u001b[43m(\u001b[49m\u001b[38;5;124;43m\"\u001b[39;49m\u001b[38;5;124;43m/examples/3.1-table.csv\u001b[39;49m\u001b[38;5;124;43m\"\u001b[39;49m\u001b[43m)\u001b[49m\n",
      "File \u001b[1;32mD:\\miniconda3\\envs\\pydata-book\\lib\\site-packages\\pandas\\io\\parsers\\readers.py:912\u001b[0m, in \u001b[0;36mread_csv\u001b[1;34m(filepath_or_buffer, sep, delimiter, header, names, index_col, usecols, dtype, engine, converters, true_values, false_values, skipinitialspace, skiprows, skipfooter, nrows, na_values, keep_default_na, na_filter, verbose, skip_blank_lines, parse_dates, infer_datetime_format, keep_date_col, date_parser, date_format, dayfirst, cache_dates, iterator, chunksize, compression, thousands, decimal, lineterminator, quotechar, quoting, doublequote, escapechar, comment, encoding, encoding_errors, dialect, on_bad_lines, delim_whitespace, low_memory, memory_map, float_precision, storage_options, dtype_backend)\u001b[0m\n\u001b[0;32m    899\u001b[0m kwds_defaults \u001b[38;5;241m=\u001b[39m _refine_defaults_read(\n\u001b[0;32m    900\u001b[0m     dialect,\n\u001b[0;32m    901\u001b[0m     delimiter,\n\u001b[1;32m   (...)\u001b[0m\n\u001b[0;32m    908\u001b[0m     dtype_backend\u001b[38;5;241m=\u001b[39mdtype_backend,\n\u001b[0;32m    909\u001b[0m )\n\u001b[0;32m    910\u001b[0m kwds\u001b[38;5;241m.\u001b[39mupdate(kwds_defaults)\n\u001b[1;32m--> 912\u001b[0m \u001b[38;5;28;01mreturn\u001b[39;00m \u001b[43m_read\u001b[49m\u001b[43m(\u001b[49m\u001b[43mfilepath_or_buffer\u001b[49m\u001b[43m,\u001b[49m\u001b[43m \u001b[49m\u001b[43mkwds\u001b[49m\u001b[43m)\u001b[49m\n",
      "File \u001b[1;32mD:\\miniconda3\\envs\\pydata-book\\lib\\site-packages\\pandas\\io\\parsers\\readers.py:577\u001b[0m, in \u001b[0;36m_read\u001b[1;34m(filepath_or_buffer, kwds)\u001b[0m\n\u001b[0;32m    574\u001b[0m _validate_names(kwds\u001b[38;5;241m.\u001b[39mget(\u001b[38;5;124m\"\u001b[39m\u001b[38;5;124mnames\u001b[39m\u001b[38;5;124m\"\u001b[39m, \u001b[38;5;28;01mNone\u001b[39;00m))\n\u001b[0;32m    576\u001b[0m \u001b[38;5;66;03m# Create the parser.\u001b[39;00m\n\u001b[1;32m--> 577\u001b[0m parser \u001b[38;5;241m=\u001b[39m \u001b[43mTextFileReader\u001b[49m\u001b[43m(\u001b[49m\u001b[43mfilepath_or_buffer\u001b[49m\u001b[43m,\u001b[49m\u001b[43m \u001b[49m\u001b[38;5;241;43m*\u001b[39;49m\u001b[38;5;241;43m*\u001b[39;49m\u001b[43mkwds\u001b[49m\u001b[43m)\u001b[49m\n\u001b[0;32m    579\u001b[0m \u001b[38;5;28;01mif\u001b[39;00m chunksize \u001b[38;5;129;01mor\u001b[39;00m iterator:\n\u001b[0;32m    580\u001b[0m     \u001b[38;5;28;01mreturn\u001b[39;00m parser\n",
      "File \u001b[1;32mD:\\miniconda3\\envs\\pydata-book\\lib\\site-packages\\pandas\\io\\parsers\\readers.py:1407\u001b[0m, in \u001b[0;36mTextFileReader.__init__\u001b[1;34m(self, f, engine, **kwds)\u001b[0m\n\u001b[0;32m   1404\u001b[0m     \u001b[38;5;28mself\u001b[39m\u001b[38;5;241m.\u001b[39moptions[\u001b[38;5;124m\"\u001b[39m\u001b[38;5;124mhas_index_names\u001b[39m\u001b[38;5;124m\"\u001b[39m] \u001b[38;5;241m=\u001b[39m kwds[\u001b[38;5;124m\"\u001b[39m\u001b[38;5;124mhas_index_names\u001b[39m\u001b[38;5;124m\"\u001b[39m]\n\u001b[0;32m   1406\u001b[0m \u001b[38;5;28mself\u001b[39m\u001b[38;5;241m.\u001b[39mhandles: IOHandles \u001b[38;5;241m|\u001b[39m \u001b[38;5;28;01mNone\u001b[39;00m \u001b[38;5;241m=\u001b[39m \u001b[38;5;28;01mNone\u001b[39;00m\n\u001b[1;32m-> 1407\u001b[0m \u001b[38;5;28mself\u001b[39m\u001b[38;5;241m.\u001b[39m_engine \u001b[38;5;241m=\u001b[39m \u001b[38;5;28;43mself\u001b[39;49m\u001b[38;5;241;43m.\u001b[39;49m\u001b[43m_make_engine\u001b[49m\u001b[43m(\u001b[49m\u001b[43mf\u001b[49m\u001b[43m,\u001b[49m\u001b[43m \u001b[49m\u001b[38;5;28;43mself\u001b[39;49m\u001b[38;5;241;43m.\u001b[39;49m\u001b[43mengine\u001b[49m\u001b[43m)\u001b[49m\n",
      "File \u001b[1;32mD:\\miniconda3\\envs\\pydata-book\\lib\\site-packages\\pandas\\io\\parsers\\readers.py:1661\u001b[0m, in \u001b[0;36mTextFileReader._make_engine\u001b[1;34m(self, f, engine)\u001b[0m\n\u001b[0;32m   1659\u001b[0m     \u001b[38;5;28;01mif\u001b[39;00m \u001b[38;5;124m\"\u001b[39m\u001b[38;5;124mb\u001b[39m\u001b[38;5;124m\"\u001b[39m \u001b[38;5;129;01mnot\u001b[39;00m \u001b[38;5;129;01min\u001b[39;00m mode:\n\u001b[0;32m   1660\u001b[0m         mode \u001b[38;5;241m+\u001b[39m\u001b[38;5;241m=\u001b[39m \u001b[38;5;124m\"\u001b[39m\u001b[38;5;124mb\u001b[39m\u001b[38;5;124m\"\u001b[39m\n\u001b[1;32m-> 1661\u001b[0m \u001b[38;5;28mself\u001b[39m\u001b[38;5;241m.\u001b[39mhandles \u001b[38;5;241m=\u001b[39m \u001b[43mget_handle\u001b[49m\u001b[43m(\u001b[49m\n\u001b[0;32m   1662\u001b[0m \u001b[43m    \u001b[49m\u001b[43mf\u001b[49m\u001b[43m,\u001b[49m\n\u001b[0;32m   1663\u001b[0m \u001b[43m    \u001b[49m\u001b[43mmode\u001b[49m\u001b[43m,\u001b[49m\n\u001b[0;32m   1664\u001b[0m \u001b[43m    \u001b[49m\u001b[43mencoding\u001b[49m\u001b[38;5;241;43m=\u001b[39;49m\u001b[38;5;28;43mself\u001b[39;49m\u001b[38;5;241;43m.\u001b[39;49m\u001b[43moptions\u001b[49m\u001b[38;5;241;43m.\u001b[39;49m\u001b[43mget\u001b[49m\u001b[43m(\u001b[49m\u001b[38;5;124;43m\"\u001b[39;49m\u001b[38;5;124;43mencoding\u001b[39;49m\u001b[38;5;124;43m\"\u001b[39;49m\u001b[43m,\u001b[49m\u001b[43m \u001b[49m\u001b[38;5;28;43;01mNone\u001b[39;49;00m\u001b[43m)\u001b[49m\u001b[43m,\u001b[49m\n\u001b[0;32m   1665\u001b[0m \u001b[43m    \u001b[49m\u001b[43mcompression\u001b[49m\u001b[38;5;241;43m=\u001b[39;49m\u001b[38;5;28;43mself\u001b[39;49m\u001b[38;5;241;43m.\u001b[39;49m\u001b[43moptions\u001b[49m\u001b[38;5;241;43m.\u001b[39;49m\u001b[43mget\u001b[49m\u001b[43m(\u001b[49m\u001b[38;5;124;43m\"\u001b[39;49m\u001b[38;5;124;43mcompression\u001b[39;49m\u001b[38;5;124;43m\"\u001b[39;49m\u001b[43m,\u001b[49m\u001b[43m \u001b[49m\u001b[38;5;28;43;01mNone\u001b[39;49;00m\u001b[43m)\u001b[49m\u001b[43m,\u001b[49m\n\u001b[0;32m   1666\u001b[0m \u001b[43m    \u001b[49m\u001b[43mmemory_map\u001b[49m\u001b[38;5;241;43m=\u001b[39;49m\u001b[38;5;28;43mself\u001b[39;49m\u001b[38;5;241;43m.\u001b[39;49m\u001b[43moptions\u001b[49m\u001b[38;5;241;43m.\u001b[39;49m\u001b[43mget\u001b[49m\u001b[43m(\u001b[49m\u001b[38;5;124;43m\"\u001b[39;49m\u001b[38;5;124;43mmemory_map\u001b[39;49m\u001b[38;5;124;43m\"\u001b[39;49m\u001b[43m,\u001b[49m\u001b[43m \u001b[49m\u001b[38;5;28;43;01mFalse\u001b[39;49;00m\u001b[43m)\u001b[49m\u001b[43m,\u001b[49m\n\u001b[0;32m   1667\u001b[0m \u001b[43m    \u001b[49m\u001b[43mis_text\u001b[49m\u001b[38;5;241;43m=\u001b[39;49m\u001b[43mis_text\u001b[49m\u001b[43m,\u001b[49m\n\u001b[0;32m   1668\u001b[0m \u001b[43m    \u001b[49m\u001b[43merrors\u001b[49m\u001b[38;5;241;43m=\u001b[39;49m\u001b[38;5;28;43mself\u001b[39;49m\u001b[38;5;241;43m.\u001b[39;49m\u001b[43moptions\u001b[49m\u001b[38;5;241;43m.\u001b[39;49m\u001b[43mget\u001b[49m\u001b[43m(\u001b[49m\u001b[38;5;124;43m\"\u001b[39;49m\u001b[38;5;124;43mencoding_errors\u001b[39;49m\u001b[38;5;124;43m\"\u001b[39;49m\u001b[43m,\u001b[49m\u001b[43m \u001b[49m\u001b[38;5;124;43m\"\u001b[39;49m\u001b[38;5;124;43mstrict\u001b[39;49m\u001b[38;5;124;43m\"\u001b[39;49m\u001b[43m)\u001b[49m\u001b[43m,\u001b[49m\n\u001b[0;32m   1669\u001b[0m \u001b[43m    \u001b[49m\u001b[43mstorage_options\u001b[49m\u001b[38;5;241;43m=\u001b[39;49m\u001b[38;5;28;43mself\u001b[39;49m\u001b[38;5;241;43m.\u001b[39;49m\u001b[43moptions\u001b[49m\u001b[38;5;241;43m.\u001b[39;49m\u001b[43mget\u001b[49m\u001b[43m(\u001b[49m\u001b[38;5;124;43m\"\u001b[39;49m\u001b[38;5;124;43mstorage_options\u001b[39;49m\u001b[38;5;124;43m\"\u001b[39;49m\u001b[43m,\u001b[49m\u001b[43m \u001b[49m\u001b[38;5;28;43;01mNone\u001b[39;49;00m\u001b[43m)\u001b[49m\u001b[43m,\u001b[49m\n\u001b[0;32m   1670\u001b[0m \u001b[43m\u001b[49m\u001b[43m)\u001b[49m\n\u001b[0;32m   1671\u001b[0m \u001b[38;5;28;01massert\u001b[39;00m \u001b[38;5;28mself\u001b[39m\u001b[38;5;241m.\u001b[39mhandles \u001b[38;5;129;01mis\u001b[39;00m \u001b[38;5;129;01mnot\u001b[39;00m \u001b[38;5;28;01mNone\u001b[39;00m\n\u001b[0;32m   1672\u001b[0m f \u001b[38;5;241m=\u001b[39m \u001b[38;5;28mself\u001b[39m\u001b[38;5;241m.\u001b[39mhandles\u001b[38;5;241m.\u001b[39mhandle\n",
      "File \u001b[1;32mD:\\miniconda3\\envs\\pydata-book\\lib\\site-packages\\pandas\\io\\common.py:859\u001b[0m, in \u001b[0;36mget_handle\u001b[1;34m(path_or_buf, mode, encoding, compression, memory_map, is_text, errors, storage_options)\u001b[0m\n\u001b[0;32m    854\u001b[0m \u001b[38;5;28;01melif\u001b[39;00m \u001b[38;5;28misinstance\u001b[39m(handle, \u001b[38;5;28mstr\u001b[39m):\n\u001b[0;32m    855\u001b[0m     \u001b[38;5;66;03m# Check whether the filename is to be opened in binary mode.\u001b[39;00m\n\u001b[0;32m    856\u001b[0m     \u001b[38;5;66;03m# Binary mode does not support 'encoding' and 'newline'.\u001b[39;00m\n\u001b[0;32m    857\u001b[0m     \u001b[38;5;28;01mif\u001b[39;00m ioargs\u001b[38;5;241m.\u001b[39mencoding \u001b[38;5;129;01mand\u001b[39;00m \u001b[38;5;124m\"\u001b[39m\u001b[38;5;124mb\u001b[39m\u001b[38;5;124m\"\u001b[39m \u001b[38;5;129;01mnot\u001b[39;00m \u001b[38;5;129;01min\u001b[39;00m ioargs\u001b[38;5;241m.\u001b[39mmode:\n\u001b[0;32m    858\u001b[0m         \u001b[38;5;66;03m# Encoding\u001b[39;00m\n\u001b[1;32m--> 859\u001b[0m         handle \u001b[38;5;241m=\u001b[39m \u001b[38;5;28;43mopen\u001b[39;49m\u001b[43m(\u001b[49m\n\u001b[0;32m    860\u001b[0m \u001b[43m            \u001b[49m\u001b[43mhandle\u001b[49m\u001b[43m,\u001b[49m\n\u001b[0;32m    861\u001b[0m \u001b[43m            \u001b[49m\u001b[43mioargs\u001b[49m\u001b[38;5;241;43m.\u001b[39;49m\u001b[43mmode\u001b[49m\u001b[43m,\u001b[49m\n\u001b[0;32m    862\u001b[0m \u001b[43m            \u001b[49m\u001b[43mencoding\u001b[49m\u001b[38;5;241;43m=\u001b[39;49m\u001b[43mioargs\u001b[49m\u001b[38;5;241;43m.\u001b[39;49m\u001b[43mencoding\u001b[49m\u001b[43m,\u001b[49m\n\u001b[0;32m    863\u001b[0m \u001b[43m            \u001b[49m\u001b[43merrors\u001b[49m\u001b[38;5;241;43m=\u001b[39;49m\u001b[43merrors\u001b[49m\u001b[43m,\u001b[49m\n\u001b[0;32m    864\u001b[0m \u001b[43m            \u001b[49m\u001b[43mnewline\u001b[49m\u001b[38;5;241;43m=\u001b[39;49m\u001b[38;5;124;43m\"\u001b[39;49m\u001b[38;5;124;43m\"\u001b[39;49m\u001b[43m,\u001b[49m\n\u001b[0;32m    865\u001b[0m \u001b[43m        \u001b[49m\u001b[43m)\u001b[49m\n\u001b[0;32m    866\u001b[0m     \u001b[38;5;28;01melse\u001b[39;00m:\n\u001b[0;32m    867\u001b[0m         \u001b[38;5;66;03m# Binary mode\u001b[39;00m\n\u001b[0;32m    868\u001b[0m         handle \u001b[38;5;241m=\u001b[39m \u001b[38;5;28mopen\u001b[39m(handle, ioargs\u001b[38;5;241m.\u001b[39mmode)\n",
      "\u001b[1;31mFileNotFoundError\u001b[0m: [Errno 2] No such file or directory: '/examples/3.1-table.csv'"
     ]
    }
   ],
   "source": [
    "data_3 = pd.read_csv(\"/examples/3.1-table.csv\")"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 71,
   "id": "69894385",
   "metadata": {},
   "outputs": [],
   "source": [
    "data_3 = pd.read_csv(\"examples/3.1-table.csv\")"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 72,
   "id": "4544f935",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style scoped>\n",
       "    .dataframe tbody tr th:only-of-type {\n",
       "        vertical-align: middle;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: right;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>Contact</th>\n",
       "      <th>Maxtemp</th>\n",
       "      <th>Weight</th>\n",
       "      <th>Height</th>\n",
       "      <th>Years</th>\n",
       "      <th>Gender</th>\n",
       "      <th>Company</th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>0</th>\n",
       "      <td>Andrew</td>\n",
       "      <td>25</td>\n",
       "      <td>77</td>\n",
       "      <td>175</td>\n",
       "      <td>10</td>\n",
       "      <td>M</td>\n",
       "      <td>Good</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>1</th>\n",
       "      <td>Bernhard</td>\n",
       "      <td>31</td>\n",
       "      <td>110</td>\n",
       "      <td>195</td>\n",
       "      <td>12</td>\n",
       "      <td>M</td>\n",
       "      <td>Good</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2</th>\n",
       "      <td>Carolina</td>\n",
       "      <td>15</td>\n",
       "      <td>70</td>\n",
       "      <td>172</td>\n",
       "      <td>2</td>\n",
       "      <td>F</td>\n",
       "      <td>Bad</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>3</th>\n",
       "      <td>Dennis</td>\n",
       "      <td>20</td>\n",
       "      <td>85</td>\n",
       "      <td>180</td>\n",
       "      <td>16</td>\n",
       "      <td>M</td>\n",
       "      <td>Good</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>4</th>\n",
       "      <td>Eve</td>\n",
       "      <td>10</td>\n",
       "      <td>65</td>\n",
       "      <td>168</td>\n",
       "      <td>0</td>\n",
       "      <td>F</td>\n",
       "      <td>Bad</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>5</th>\n",
       "      <td>Fred</td>\n",
       "      <td>12</td>\n",
       "      <td>75</td>\n",
       "      <td>173</td>\n",
       "      <td>6</td>\n",
       "      <td>M</td>\n",
       "      <td>Good</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>6</th>\n",
       "      <td>Gwyneth</td>\n",
       "      <td>16</td>\n",
       "      <td>75</td>\n",
       "      <td>180</td>\n",
       "      <td>3</td>\n",
       "      <td>F</td>\n",
       "      <td>Bad</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>7</th>\n",
       "      <td>Hayden</td>\n",
       "      <td>26</td>\n",
       "      <td>63</td>\n",
       "      <td>165</td>\n",
       "      <td>2</td>\n",
       "      <td>F</td>\n",
       "      <td>Bad</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>8</th>\n",
       "      <td>Irene</td>\n",
       "      <td>15</td>\n",
       "      <td>55</td>\n",
       "      <td>158</td>\n",
       "      <td>5</td>\n",
       "      <td>F</td>\n",
       "      <td>Bad</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>9</th>\n",
       "      <td>James</td>\n",
       "      <td>21</td>\n",
       "      <td>66</td>\n",
       "      <td>163</td>\n",
       "      <td>14</td>\n",
       "      <td>M</td>\n",
       "      <td>Good</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>10</th>\n",
       "      <td>Kevin</td>\n",
       "      <td>30</td>\n",
       "      <td>95</td>\n",
       "      <td>190</td>\n",
       "      <td>1</td>\n",
       "      <td>M</td>\n",
       "      <td>Bad</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>11</th>\n",
       "      <td>Lea</td>\n",
       "      <td>13</td>\n",
       "      <td>72</td>\n",
       "      <td>172</td>\n",
       "      <td>11</td>\n",
       "      <td>F</td>\n",
       "      <td>Good</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>12</th>\n",
       "      <td>Marcus</td>\n",
       "      <td>8</td>\n",
       "      <td>83</td>\n",
       "      <td>185</td>\n",
       "      <td>3</td>\n",
       "      <td>F</td>\n",
       "      <td>Bad</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>13</th>\n",
       "      <td>Nigel</td>\n",
       "      <td>12</td>\n",
       "      <td>115</td>\n",
       "      <td>192</td>\n",
       "      <td>15</td>\n",
       "      <td>M</td>\n",
       "      <td>Good</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "</div>"
      ],
      "text/plain": [
       "     Contact  Maxtemp  Weight  Height  Years Gender Company\n",
       "0     Andrew       25      77     175     10      M    Good\n",
       "1   Bernhard       31     110     195     12      M    Good\n",
       "2   Carolina       15      70     172      2      F     Bad\n",
       "3     Dennis       20      85     180     16      M    Good\n",
       "4        Eve       10      65     168      0      F     Bad\n",
       "5       Fred       12      75     173      6      M    Good\n",
       "6    Gwyneth       16      75     180      3      F     Bad\n",
       "7     Hayden       26      63     165      2      F     Bad\n",
       "8      Irene       15      55     158      5      F     Bad\n",
       "9      James       21      66     163     14      M    Good\n",
       "10     Kevin       30      95     190      1      M     Bad\n",
       "11       Lea       13      72     172     11      F    Good\n",
       "12    Marcus        8      83     185      3      F     Bad\n",
       "13     Nigel       12     115     192     15      M    Good"
      ]
     },
     "execution_count": 72,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "data_3"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 73,
   "id": "3c130109",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style scoped>\n",
       "    .dataframe tbody tr th:only-of-type {\n",
       "        vertical-align: middle;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: right;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>Contact</th>\n",
       "      <th>Maxtemp</th>\n",
       "      <th>Weight</th>\n",
       "      <th>Height</th>\n",
       "      <th>Years</th>\n",
       "      <th>Gender</th>\n",
       "      <th>Company</th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>1</th>\n",
       "      <td>Bernhard</td>\n",
       "      <td>31</td>\n",
       "      <td>110</td>\n",
       "      <td>195</td>\n",
       "      <td>12</td>\n",
       "      <td>M</td>\n",
       "      <td>Good</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2</th>\n",
       "      <td>Carolina</td>\n",
       "      <td>15</td>\n",
       "      <td>70</td>\n",
       "      <td>172</td>\n",
       "      <td>2</td>\n",
       "      <td>F</td>\n",
       "      <td>Bad</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>3</th>\n",
       "      <td>Dennis</td>\n",
       "      <td>20</td>\n",
       "      <td>85</td>\n",
       "      <td>180</td>\n",
       "      <td>16</td>\n",
       "      <td>M</td>\n",
       "      <td>Good</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "</div>"
      ],
      "text/plain": [
       "    Contact  Maxtemp  Weight  Height  Years Gender Company\n",
       "1  Bernhard       31     110     195     12      M    Good\n",
       "2  Carolina       15      70     172      2      F     Bad\n",
       "3    Dennis       20      85     180     16      M    Good"
      ]
     },
     "execution_count": 73,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "data_3.loc[:][1:4]"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 74,
   "id": "2408e6fd",
   "metadata": {},
   "outputs": [
    {
     "ename": "TypeError",
     "evalue": "'tuple' object is not callable",
     "output_type": "error",
     "traceback": [
      "\u001b[1;31m---------------------------------------------------------------------------\u001b[0m",
      "\u001b[1;31mTypeError\u001b[0m                                 Traceback (most recent call last)",
      "Cell \u001b[1;32mIn[74], line 1\u001b[0m\n\u001b[1;32m----> 1\u001b[0m \u001b[43mdata_3\u001b[49m\u001b[38;5;241;43m.\u001b[39;49m\u001b[43mshape\u001b[49m\u001b[43m(\u001b[49m\u001b[43m)\u001b[49m\n",
      "\u001b[1;31mTypeError\u001b[0m: 'tuple' object is not callable"
     ]
    }
   ],
   "source": [
    "data_3.shape()"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 75,
   "id": "13e78502",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "(14, 7)"
      ]
     },
     "execution_count": 75,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "data_3.shape"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 76,
   "id": "e1af94b7",
   "metadata": {},
   "outputs": [
    {
     "ename": "AttributeError",
     "evalue": "'DataFrame' object has no attribute 'type'",
     "output_type": "error",
     "traceback": [
      "\u001b[1;31m---------------------------------------------------------------------------\u001b[0m",
      "\u001b[1;31mAttributeError\u001b[0m                            Traceback (most recent call last)",
      "Cell \u001b[1;32mIn[76], line 1\u001b[0m\n\u001b[1;32m----> 1\u001b[0m \u001b[43mdata_3\u001b[49m\u001b[38;5;241;43m.\u001b[39;49m\u001b[43mtype\u001b[49m\n",
      "File \u001b[1;32mD:\\miniconda3\\envs\\pydata-book\\lib\\site-packages\\pandas\\core\\generic.py:5989\u001b[0m, in \u001b[0;36mNDFrame.__getattr__\u001b[1;34m(self, name)\u001b[0m\n\u001b[0;32m   5982\u001b[0m \u001b[38;5;28;01mif\u001b[39;00m (\n\u001b[0;32m   5983\u001b[0m     name \u001b[38;5;129;01mnot\u001b[39;00m \u001b[38;5;129;01min\u001b[39;00m \u001b[38;5;28mself\u001b[39m\u001b[38;5;241m.\u001b[39m_internal_names_set\n\u001b[0;32m   5984\u001b[0m     \u001b[38;5;129;01mand\u001b[39;00m name \u001b[38;5;129;01mnot\u001b[39;00m \u001b[38;5;129;01min\u001b[39;00m \u001b[38;5;28mself\u001b[39m\u001b[38;5;241m.\u001b[39m_metadata\n\u001b[0;32m   5985\u001b[0m     \u001b[38;5;129;01mand\u001b[39;00m name \u001b[38;5;129;01mnot\u001b[39;00m \u001b[38;5;129;01min\u001b[39;00m \u001b[38;5;28mself\u001b[39m\u001b[38;5;241m.\u001b[39m_accessors\n\u001b[0;32m   5986\u001b[0m     \u001b[38;5;129;01mand\u001b[39;00m \u001b[38;5;28mself\u001b[39m\u001b[38;5;241m.\u001b[39m_info_axis\u001b[38;5;241m.\u001b[39m_can_hold_identifiers_and_holds_name(name)\n\u001b[0;32m   5987\u001b[0m ):\n\u001b[0;32m   5988\u001b[0m     \u001b[38;5;28;01mreturn\u001b[39;00m \u001b[38;5;28mself\u001b[39m[name]\n\u001b[1;32m-> 5989\u001b[0m \u001b[38;5;28;01mreturn\u001b[39;00m \u001b[38;5;28;43mobject\u001b[39;49m\u001b[38;5;241;43m.\u001b[39;49m\u001b[38;5;21;43m__getattribute__\u001b[39;49m\u001b[43m(\u001b[49m\u001b[38;5;28;43mself\u001b[39;49m\u001b[43m,\u001b[49m\u001b[43m \u001b[49m\u001b[43mname\u001b[49m\u001b[43m)\u001b[49m\n",
      "\u001b[1;31mAttributeError\u001b[0m: 'DataFrame' object has no attribute 'type'"
     ]
    }
   ],
   "source": [
    "data_3.type"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 77,
   "id": "778b3945",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style scoped>\n",
       "    .dataframe tbody tr th:only-of-type {\n",
       "        vertical-align: middle;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: right;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>Contact</th>\n",
       "      <th>Maxtemp</th>\n",
       "      <th>Weight</th>\n",
       "      <th>Height</th>\n",
       "      <th>Years</th>\n",
       "      <th>Gender</th>\n",
       "      <th>Company</th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>0</th>\n",
       "      <td>Andrew</td>\n",
       "      <td>25</td>\n",
       "      <td>77</td>\n",
       "      <td>175</td>\n",
       "      <td>10</td>\n",
       "      <td>M</td>\n",
       "      <td>Good</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>1</th>\n",
       "      <td>Bernhard</td>\n",
       "      <td>31</td>\n",
       "      <td>110</td>\n",
       "      <td>195</td>\n",
       "      <td>12</td>\n",
       "      <td>M</td>\n",
       "      <td>Good</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2</th>\n",
       "      <td>Carolina</td>\n",
       "      <td>15</td>\n",
       "      <td>70</td>\n",
       "      <td>172</td>\n",
       "      <td>2</td>\n",
       "      <td>F</td>\n",
       "      <td>Bad</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>3</th>\n",
       "      <td>Dennis</td>\n",
       "      <td>20</td>\n",
       "      <td>85</td>\n",
       "      <td>180</td>\n",
       "      <td>16</td>\n",
       "      <td>M</td>\n",
       "      <td>Good</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>4</th>\n",
       "      <td>Eve</td>\n",
       "      <td>10</td>\n",
       "      <td>65</td>\n",
       "      <td>168</td>\n",
       "      <td>0</td>\n",
       "      <td>F</td>\n",
       "      <td>Bad</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>5</th>\n",
       "      <td>Fred</td>\n",
       "      <td>12</td>\n",
       "      <td>75</td>\n",
       "      <td>173</td>\n",
       "      <td>6</td>\n",
       "      <td>M</td>\n",
       "      <td>Good</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>6</th>\n",
       "      <td>Gwyneth</td>\n",
       "      <td>16</td>\n",
       "      <td>75</td>\n",
       "      <td>180</td>\n",
       "      <td>3</td>\n",
       "      <td>F</td>\n",
       "      <td>Bad</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>7</th>\n",
       "      <td>Hayden</td>\n",
       "      <td>26</td>\n",
       "      <td>63</td>\n",
       "      <td>165</td>\n",
       "      <td>2</td>\n",
       "      <td>F</td>\n",
       "      <td>Bad</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>8</th>\n",
       "      <td>Irene</td>\n",
       "      <td>15</td>\n",
       "      <td>55</td>\n",
       "      <td>158</td>\n",
       "      <td>5</td>\n",
       "      <td>F</td>\n",
       "      <td>Bad</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>9</th>\n",
       "      <td>James</td>\n",
       "      <td>21</td>\n",
       "      <td>66</td>\n",
       "      <td>163</td>\n",
       "      <td>14</td>\n",
       "      <td>M</td>\n",
       "      <td>Good</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>10</th>\n",
       "      <td>Kevin</td>\n",
       "      <td>30</td>\n",
       "      <td>95</td>\n",
       "      <td>190</td>\n",
       "      <td>1</td>\n",
       "      <td>M</td>\n",
       "      <td>Bad</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>11</th>\n",
       "      <td>Lea</td>\n",
       "      <td>13</td>\n",
       "      <td>72</td>\n",
       "      <td>172</td>\n",
       "      <td>11</td>\n",
       "      <td>F</td>\n",
       "      <td>Good</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>12</th>\n",
       "      <td>Marcus</td>\n",
       "      <td>8</td>\n",
       "      <td>83</td>\n",
       "      <td>185</td>\n",
       "      <td>3</td>\n",
       "      <td>F</td>\n",
       "      <td>Bad</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>13</th>\n",
       "      <td>Nigel</td>\n",
       "      <td>12</td>\n",
       "      <td>115</td>\n",
       "      <td>192</td>\n",
       "      <td>15</td>\n",
       "      <td>M</td>\n",
       "      <td>Good</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "</div>"
      ],
      "text/plain": [
       "     Contact  Maxtemp  Weight  Height  Years Gender Company\n",
       "0     Andrew       25      77     175     10      M    Good\n",
       "1   Bernhard       31     110     195     12      M    Good\n",
       "2   Carolina       15      70     172      2      F     Bad\n",
       "3     Dennis       20      85     180     16      M    Good\n",
       "4        Eve       10      65     168      0      F     Bad\n",
       "5       Fred       12      75     173      6      M    Good\n",
       "6    Gwyneth       16      75     180      3      F     Bad\n",
       "7     Hayden       26      63     165      2      F     Bad\n",
       "8      Irene       15      55     158      5      F     Bad\n",
       "9      James       21      66     163     14      M    Good\n",
       "10     Kevin       30      95     190      1      M     Bad\n",
       "11       Lea       13      72     172     11      F    Good\n",
       "12    Marcus        8      83     185      3      F     Bad\n",
       "13     Nigel       12     115     192     15      M    Good"
      ]
     },
     "execution_count": 77,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "data_3"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 78,
   "id": "3d88e601",
   "metadata": {},
   "outputs": [
    {
     "ename": "SyntaxError",
     "evalue": "invalid syntax (3271304411.py, line 1)",
     "output_type": "error",
     "traceback": [
      "\u001b[1;36m  Cell \u001b[1;32mIn[78], line 1\u001b[1;36m\u001b[0m\n\u001b[1;33m    data3.iloc[,1:4]\u001b[0m\n\u001b[1;37m               ^\u001b[0m\n\u001b[1;31mSyntaxError\u001b[0m\u001b[1;31m:\u001b[0m invalid syntax\n"
     ]
    }
   ],
   "source": [
    "data3.iloc[,1:4]"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 79,
   "id": "d38ddbfa",
   "metadata": {},
   "outputs": [
    {
     "ename": "SyntaxError",
     "evalue": "invalid syntax (212410957.py, line 1)",
     "output_type": "error",
     "traceback": [
      "\u001b[1;36m  Cell \u001b[1;32mIn[79], line 1\u001b[1;36m\u001b[0m\n\u001b[1;33m    data_3.iloc[,1:4]\u001b[0m\n\u001b[1;37m                ^\u001b[0m\n\u001b[1;31mSyntaxError\u001b[0m\u001b[1;31m:\u001b[0m invalid syntax\n"
     ]
    }
   ],
   "source": [
    "data_3.iloc[,1:4]"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 80,
   "id": "85a52d44",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style scoped>\n",
       "    .dataframe tbody tr th:only-of-type {\n",
       "        vertical-align: middle;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: right;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>Maxtemp</th>\n",
       "      <th>Weight</th>\n",
       "      <th>Height</th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>0</th>\n",
       "      <td>25</td>\n",
       "      <td>77</td>\n",
       "      <td>175</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>1</th>\n",
       "      <td>31</td>\n",
       "      <td>110</td>\n",
       "      <td>195</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2</th>\n",
       "      <td>15</td>\n",
       "      <td>70</td>\n",
       "      <td>172</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>3</th>\n",
       "      <td>20</td>\n",
       "      <td>85</td>\n",
       "      <td>180</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>4</th>\n",
       "      <td>10</td>\n",
       "      <td>65</td>\n",
       "      <td>168</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>5</th>\n",
       "      <td>12</td>\n",
       "      <td>75</td>\n",
       "      <td>173</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>6</th>\n",
       "      <td>16</td>\n",
       "      <td>75</td>\n",
       "      <td>180</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>7</th>\n",
       "      <td>26</td>\n",
       "      <td>63</td>\n",
       "      <td>165</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>8</th>\n",
       "      <td>15</td>\n",
       "      <td>55</td>\n",
       "      <td>158</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>9</th>\n",
       "      <td>21</td>\n",
       "      <td>66</td>\n",
       "      <td>163</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>10</th>\n",
       "      <td>30</td>\n",
       "      <td>95</td>\n",
       "      <td>190</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>11</th>\n",
       "      <td>13</td>\n",
       "      <td>72</td>\n",
       "      <td>172</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>12</th>\n",
       "      <td>8</td>\n",
       "      <td>83</td>\n",
       "      <td>185</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>13</th>\n",
       "      <td>12</td>\n",
       "      <td>115</td>\n",
       "      <td>192</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "</div>"
      ],
      "text/plain": [
       "    Maxtemp  Weight  Height\n",
       "0        25      77     175\n",
       "1        31     110     195\n",
       "2        15      70     172\n",
       "3        20      85     180\n",
       "4        10      65     168\n",
       "5        12      75     173\n",
       "6        16      75     180\n",
       "7        26      63     165\n",
       "8        15      55     158\n",
       "9        21      66     163\n",
       "10       30      95     190\n",
       "11       13      72     172\n",
       "12        8      83     185\n",
       "13       12     115     192"
      ]
     },
     "execution_count": 80,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "data_3.iloc[:,1:4]"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 81,
   "id": "95543f6d",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style scoped>\n",
       "    .dataframe tbody tr th:only-of-type {\n",
       "        vertical-align: middle;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: right;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>Maxtemp</th>\n",
       "      <th>Weight</th>\n",
       "      <th>Height</th>\n",
       "      <th>Years</th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>0</th>\n",
       "      <td>25</td>\n",
       "      <td>77</td>\n",
       "      <td>175</td>\n",
       "      <td>10</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>1</th>\n",
       "      <td>31</td>\n",
       "      <td>110</td>\n",
       "      <td>195</td>\n",
       "      <td>12</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2</th>\n",
       "      <td>15</td>\n",
       "      <td>70</td>\n",
       "      <td>172</td>\n",
       "      <td>2</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>3</th>\n",
       "      <td>20</td>\n",
       "      <td>85</td>\n",
       "      <td>180</td>\n",
       "      <td>16</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>4</th>\n",
       "      <td>10</td>\n",
       "      <td>65</td>\n",
       "      <td>168</td>\n",
       "      <td>0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>5</th>\n",
       "      <td>12</td>\n",
       "      <td>75</td>\n",
       "      <td>173</td>\n",
       "      <td>6</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>6</th>\n",
       "      <td>16</td>\n",
       "      <td>75</td>\n",
       "      <td>180</td>\n",
       "      <td>3</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>7</th>\n",
       "      <td>26</td>\n",
       "      <td>63</td>\n",
       "      <td>165</td>\n",
       "      <td>2</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>8</th>\n",
       "      <td>15</td>\n",
       "      <td>55</td>\n",
       "      <td>158</td>\n",
       "      <td>5</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>9</th>\n",
       "      <td>21</td>\n",
       "      <td>66</td>\n",
       "      <td>163</td>\n",
       "      <td>14</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>10</th>\n",
       "      <td>30</td>\n",
       "      <td>95</td>\n",
       "      <td>190</td>\n",
       "      <td>1</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>11</th>\n",
       "      <td>13</td>\n",
       "      <td>72</td>\n",
       "      <td>172</td>\n",
       "      <td>11</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>12</th>\n",
       "      <td>8</td>\n",
       "      <td>83</td>\n",
       "      <td>185</td>\n",
       "      <td>3</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>13</th>\n",
       "      <td>12</td>\n",
       "      <td>115</td>\n",
       "      <td>192</td>\n",
       "      <td>15</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "</div>"
      ],
      "text/plain": [
       "    Maxtemp  Weight  Height  Years\n",
       "0        25      77     175     10\n",
       "1        31     110     195     12\n",
       "2        15      70     172      2\n",
       "3        20      85     180     16\n",
       "4        10      65     168      0\n",
       "5        12      75     173      6\n",
       "6        16      75     180      3\n",
       "7        26      63     165      2\n",
       "8        15      55     158      5\n",
       "9        21      66     163     14\n",
       "10       30      95     190      1\n",
       "11       13      72     172     11\n",
       "12        8      83     185      3\n",
       "13       12     115     192     15"
      ]
     },
     "execution_count": 81,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "data_3.iloc[:,1:5]"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 82,
   "id": "bc24c657",
   "metadata": {
    "collapsed": true
   },
   "outputs": [
    {
     "ename": "NameError",
     "evalue": "name 'data3' is not defined",
     "output_type": "error",
     "traceback": [
      "\u001b[1;31m---------------------------------------------------------------------------\u001b[0m",
      "\u001b[1;31mNameError\u001b[0m                                 Traceback (most recent call last)",
      "Cell \u001b[1;32mIn[82], line 1\u001b[0m\n\u001b[1;32m----> 1\u001b[0m matrix \u001b[38;5;241m=\u001b[39m \u001b[43mdata3\u001b[49m\u001b[38;5;241m.\u001b[39miloc[:,\u001b[38;5;241m1\u001b[39m:\u001b[38;5;241m5\u001b[39m]\u001b[38;5;241m.\u001b[39mvalues\n",
      "\u001b[1;31mNameError\u001b[0m: name 'data3' is not defined"
     ]
    }
   ],
   "source": [
    "matrix = data3.iloc[:,1:5].values"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 83,
   "id": "d24d18ed",
   "metadata": {},
   "outputs": [],
   "source": [
    "matrix = data_3.iloc[:,1:5].values"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 84,
   "id": "2bb28d38",
   "metadata": {
    "collapsed": true
   },
   "outputs": [
    {
     "data": {
      "text/plain": [
       "array([[ 25,  77, 175,  10],\n",
       "       [ 31, 110, 195,  12],\n",
       "       [ 15,  70, 172,   2],\n",
       "       [ 20,  85, 180,  16],\n",
       "       [ 10,  65, 168,   0],\n",
       "       [ 12,  75, 173,   6],\n",
       "       [ 16,  75, 180,   3],\n",
       "       [ 26,  63, 165,   2],\n",
       "       [ 15,  55, 158,   5],\n",
       "       [ 21,  66, 163,  14],\n",
       "       [ 30,  95, 190,   1],\n",
       "       [ 13,  72, 172,  11],\n",
       "       [  8,  83, 185,   3],\n",
       "       [ 12, 115, 192,  15]], dtype=int64)"
      ]
     },
     "execution_count": 84,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "matrix"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 85,
   "id": "bae841c9",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "<pandas.core.indexing._iLocIndexer at 0x1d82470eef0>"
      ]
     },
     "execution_count": 85,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "data_3.iloc"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 86,
   "id": "08b71735",
   "metadata": {
    "collapsed": true
   },
   "outputs": [
    {
     "ename": "AttributeError",
     "evalue": "'_iLocIndexer' object has no attribute 'callable'",
     "output_type": "error",
     "traceback": [
      "\u001b[1;31m---------------------------------------------------------------------------\u001b[0m",
      "\u001b[1;31mAttributeError\u001b[0m                            Traceback (most recent call last)",
      "Cell \u001b[1;32mIn[86], line 1\u001b[0m\n\u001b[1;32m----> 1\u001b[0m \u001b[43mdata_3\u001b[49m\u001b[38;5;241;43m.\u001b[39;49m\u001b[43miloc\u001b[49m\u001b[38;5;241;43m.\u001b[39;49m\u001b[43mcallable\u001b[49m()\n",
      "\u001b[1;31mAttributeError\u001b[0m: '_iLocIndexer' object has no attribute 'callable'"
     ]
    }
   ],
   "source": [
    "data_3.iloc.callable()"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 87,
   "id": "55be9573",
   "metadata": {
    "collapsed": true
   },
   "outputs": [
    {
     "data": {
      "text/plain": [
       "Contact    Andrew\n",
       "Maxtemp        25\n",
       "Weight         77\n",
       "Height        175\n",
       "Years          10\n",
       "Gender          M\n",
       "Company      Good\n",
       "Name: 0, dtype: object"
      ]
     },
     "execution_count": 87,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "data_3.iloc[0]"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 88,
   "id": "b1cc76d3",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style scoped>\n",
       "    .dataframe tbody tr th:only-of-type {\n",
       "        vertical-align: middle;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: right;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>Contact</th>\n",
       "      <th>Maxtemp</th>\n",
       "      <th>Weight</th>\n",
       "      <th>Height</th>\n",
       "      <th>Years</th>\n",
       "      <th>Gender</th>\n",
       "      <th>Company</th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>0</th>\n",
       "      <td>Andrew</td>\n",
       "      <td>25</td>\n",
       "      <td>77</td>\n",
       "      <td>175</td>\n",
       "      <td>10</td>\n",
       "      <td>M</td>\n",
       "      <td>Good</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>1</th>\n",
       "      <td>Bernhard</td>\n",
       "      <td>31</td>\n",
       "      <td>110</td>\n",
       "      <td>195</td>\n",
       "      <td>12</td>\n",
       "      <td>M</td>\n",
       "      <td>Good</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "</div>"
      ],
      "text/plain": [
       "    Contact  Maxtemp  Weight  Height  Years Gender Company\n",
       "0    Andrew       25      77     175     10      M    Good\n",
       "1  Bernhard       31     110     195     12      M    Good"
      ]
     },
     "execution_count": 88,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "data_3.iloc[[0,1]]"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 89,
   "id": "07539b7c",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style scoped>\n",
       "    .dataframe tbody tr th:only-of-type {\n",
       "        vertical-align: middle;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: right;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>Contact</th>\n",
       "      <th>Maxtemp</th>\n",
       "      <th>Weight</th>\n",
       "      <th>Height</th>\n",
       "      <th>Years</th>\n",
       "      <th>Gender</th>\n",
       "      <th>Company</th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>1</th>\n",
       "      <td>Bernhard</td>\n",
       "      <td>31</td>\n",
       "      <td>110</td>\n",
       "      <td>195</td>\n",
       "      <td>12</td>\n",
       "      <td>M</td>\n",
       "      <td>Good</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2</th>\n",
       "      <td>Carolina</td>\n",
       "      <td>15</td>\n",
       "      <td>70</td>\n",
       "      <td>172</td>\n",
       "      <td>2</td>\n",
       "      <td>F</td>\n",
       "      <td>Bad</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "</div>"
      ],
      "text/plain": [
       "    Contact  Maxtemp  Weight  Height  Years Gender Company\n",
       "1  Bernhard       31     110     195     12      M    Good\n",
       "2  Carolina       15      70     172      2      F     Bad"
      ]
     },
     "execution_count": 89,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "data_3.iloc[1:3]"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 90,
   "id": "1196909f",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "Index(['Contact', 'Maxtemp', 'Weight', 'Height', 'Years', 'Gender', 'Company'], dtype='object')"
      ]
     },
     "execution_count": 90,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "data_3.columns"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 91,
   "id": "291a0096",
   "metadata": {},
   "outputs": [],
   "source": [
    "matrix = data_3.iloc[:,1:5]"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 92,
   "id": "313ea251",
   "metadata": {
    "collapsed": true
   },
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style scoped>\n",
       "    .dataframe tbody tr th:only-of-type {\n",
       "        vertical-align: middle;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: right;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>Maxtemp</th>\n",
       "      <th>Weight</th>\n",
       "      <th>Height</th>\n",
       "      <th>Years</th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>0</th>\n",
       "      <td>25</td>\n",
       "      <td>77</td>\n",
       "      <td>175</td>\n",
       "      <td>10</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>1</th>\n",
       "      <td>31</td>\n",
       "      <td>110</td>\n",
       "      <td>195</td>\n",
       "      <td>12</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2</th>\n",
       "      <td>15</td>\n",
       "      <td>70</td>\n",
       "      <td>172</td>\n",
       "      <td>2</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>3</th>\n",
       "      <td>20</td>\n",
       "      <td>85</td>\n",
       "      <td>180</td>\n",
       "      <td>16</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>4</th>\n",
       "      <td>10</td>\n",
       "      <td>65</td>\n",
       "      <td>168</td>\n",
       "      <td>0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>5</th>\n",
       "      <td>12</td>\n",
       "      <td>75</td>\n",
       "      <td>173</td>\n",
       "      <td>6</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>6</th>\n",
       "      <td>16</td>\n",
       "      <td>75</td>\n",
       "      <td>180</td>\n",
       "      <td>3</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>7</th>\n",
       "      <td>26</td>\n",
       "      <td>63</td>\n",
       "      <td>165</td>\n",
       "      <td>2</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>8</th>\n",
       "      <td>15</td>\n",
       "      <td>55</td>\n",
       "      <td>158</td>\n",
       "      <td>5</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>9</th>\n",
       "      <td>21</td>\n",
       "      <td>66</td>\n",
       "      <td>163</td>\n",
       "      <td>14</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>10</th>\n",
       "      <td>30</td>\n",
       "      <td>95</td>\n",
       "      <td>190</td>\n",
       "      <td>1</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>11</th>\n",
       "      <td>13</td>\n",
       "      <td>72</td>\n",
       "      <td>172</td>\n",
       "      <td>11</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>12</th>\n",
       "      <td>8</td>\n",
       "      <td>83</td>\n",
       "      <td>185</td>\n",
       "      <td>3</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>13</th>\n",
       "      <td>12</td>\n",
       "      <td>115</td>\n",
       "      <td>192</td>\n",
       "      <td>15</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "</div>"
      ],
      "text/plain": [
       "    Maxtemp  Weight  Height  Years\n",
       "0        25      77     175     10\n",
       "1        31     110     195     12\n",
       "2        15      70     172      2\n",
       "3        20      85     180     16\n",
       "4        10      65     168      0\n",
       "5        12      75     173      6\n",
       "6        16      75     180      3\n",
       "7        26      63     165      2\n",
       "8        15      55     158      5\n",
       "9        21      66     163     14\n",
       "10       30      95     190      1\n",
       "11       13      72     172     11\n",
       "12        8      83     185      3\n",
       "13       12     115     192     15"
      ]
     },
     "execution_count": 92,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "matrix"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 93,
   "id": "eb63d79c",
   "metadata": {},
   "outputs": [],
   "source": [
    "matrix = data_3.iloc[:,1:5].to_numpy()"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 94,
   "id": "5a7bf649",
   "metadata": {
    "collapsed": true
   },
   "outputs": [
    {
     "data": {
      "text/plain": [
       "array([[ 25,  77, 175,  10],\n",
       "       [ 31, 110, 195,  12],\n",
       "       [ 15,  70, 172,   2],\n",
       "       [ 20,  85, 180,  16],\n",
       "       [ 10,  65, 168,   0],\n",
       "       [ 12,  75, 173,   6],\n",
       "       [ 16,  75, 180,   3],\n",
       "       [ 26,  63, 165,   2],\n",
       "       [ 15,  55, 158,   5],\n",
       "       [ 21,  66, 163,  14],\n",
       "       [ 30,  95, 190,   1],\n",
       "       [ 13,  72, 172,  11],\n",
       "       [  8,  83, 185,   3],\n",
       "       [ 12, 115, 192,  15]], dtype=int64)"
      ]
     },
     "execution_count": 94,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "matrix"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 95,
   "id": "b3b9bf93",
   "metadata": {
    "collapsed": true
   },
   "outputs": [
    {
     "ename": "NameError",
     "evalue": "name 'maxtrix' is not defined",
     "output_type": "error",
     "traceback": [
      "\u001b[1;31m---------------------------------------------------------------------------\u001b[0m",
      "\u001b[1;31mNameError\u001b[0m                                 Traceback (most recent call last)",
      "Cell \u001b[1;32mIn[95], line 1\u001b[0m\n\u001b[1;32m----> 1\u001b[0m matrix\u001b[38;5;241m.\u001b[39mT\u001b[38;5;241m.\u001b[39mdot(\u001b[43mmaxtrix\u001b[49m)\n",
      "\u001b[1;31mNameError\u001b[0m: name 'maxtrix' is not defined"
     ]
    }
   ],
   "source": [
    "matrix.T.dot(maxtrix)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 96,
   "id": "fb61e881",
   "metadata": {
    "collapsed": true
   },
   "outputs": [
    {
     "data": {
      "text/plain": [
       "array([[  5330,  20514,  45039,   1890],\n",
       "       [ 20514,  91302, 197372,   8451],\n",
       "       [ 45039, 197372, 436718,  17811],\n",
       "       [  1890,   8451,  17811,   1130]], dtype=int64)"
      ]
     },
     "execution_count": 96,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "matrix.T.dot(matrix)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 97,
   "id": "72325afd",
   "metadata": {
    "collapsed": true
   },
   "outputs": [
    {
     "data": {
      "text/plain": [
       "array([[ 25,  77, 175,  10],\n",
       "       [ 31, 110, 195,  12],\n",
       "       [ 15,  70, 172,   2],\n",
       "       [ 20,  85, 180,  16],\n",
       "       [ 10,  65, 168,   0],\n",
       "       [ 12,  75, 173,   6],\n",
       "       [ 16,  75, 180,   3],\n",
       "       [ 26,  63, 165,   2],\n",
       "       [ 15,  55, 158,   5],\n",
       "       [ 21,  66, 163,  14],\n",
       "       [ 30,  95, 190,   1],\n",
       "       [ 13,  72, 172,  11],\n",
       "       [  8,  83, 185,   3],\n",
       "       [ 12, 115, 192,  15]], dtype=int64)"
      ]
     },
     "execution_count": 97,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "matrix"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 98,
   "id": "6bbb794d",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "array([  8,  55, 158,   0], dtype=int64)"
      ]
     },
     "execution_count": 98,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "np.min(matrix, axis=0)    "
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 99,
   "id": "ac049fba",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "0"
      ]
     },
     "execution_count": 99,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "np.min(matrix)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 100,
   "id": "a8dc8f08",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "array([10, 12,  2, 16,  0,  6,  3,  2,  5, 14,  1, 11,  3, 12],\n",
       "      dtype=int64)"
      ]
     },
     "execution_count": 100,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "np.min(matrix, axis=1)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 101,
   "id": "7a7d1ffc",
   "metadata": {
    "collapsed": true
   },
   "outputs": [
    {
     "ename": "NameError",
     "evalue": "name 'column' is not defined",
     "output_type": "error",
     "traceback": [
      "\u001b[1;31m---------------------------------------------------------------------------\u001b[0m",
      "\u001b[1;31mNameError\u001b[0m                                 Traceback (most recent call last)",
      "Cell \u001b[1;32mIn[101], line 1\u001b[0m\n\u001b[1;32m----> 1\u001b[0m np\u001b[38;5;241m.\u001b[39mmin(matrix, axis\u001b[38;5;241m=\u001b[39m\u001b[43mcolumn\u001b[49m)\n",
      "\u001b[1;31mNameError\u001b[0m: name 'column' is not defined"
     ]
    }
   ],
   "source": [
    "np.min(matrix, axis=column)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 102,
   "id": "bc2cac1b",
   "metadata": {
    "collapsed": true
   },
   "outputs": [
    {
     "ename": "TypeError",
     "evalue": "'str' object cannot be interpreted as an integer",
     "output_type": "error",
     "traceback": [
      "\u001b[1;31m---------------------------------------------------------------------------\u001b[0m",
      "\u001b[1;31mTypeError\u001b[0m                                 Traceback (most recent call last)",
      "Cell \u001b[1;32mIn[102], line 1\u001b[0m\n\u001b[1;32m----> 1\u001b[0m \u001b[43mnp\u001b[49m\u001b[38;5;241;43m.\u001b[39;49m\u001b[43mmin\u001b[49m\u001b[43m(\u001b[49m\u001b[43mmatrix\u001b[49m\u001b[43m,\u001b[49m\u001b[43m \u001b[49m\u001b[43maxis\u001b[49m\u001b[38;5;241;43m=\u001b[39;49m\u001b[38;5;124;43m\"\u001b[39;49m\u001b[38;5;124;43mcolumn\u001b[39;49m\u001b[38;5;124;43m\"\u001b[39;49m\u001b[43m)\u001b[49m\n",
      "File \u001b[1;32m<__array_function__ internals>:200\u001b[0m, in \u001b[0;36mamin\u001b[1;34m(*args, **kwargs)\u001b[0m\n",
      "File \u001b[1;32mD:\\miniconda3\\envs\\pydata-book\\lib\\site-packages\\numpy\\core\\fromnumeric.py:2946\u001b[0m, in \u001b[0;36mamin\u001b[1;34m(a, axis, out, keepdims, initial, where)\u001b[0m\n\u001b[0;32m   2829\u001b[0m \u001b[38;5;129m@array_function_dispatch\u001b[39m(_amin_dispatcher)\n\u001b[0;32m   2830\u001b[0m \u001b[38;5;28;01mdef\u001b[39;00m \u001b[38;5;21mamin\u001b[39m(a, axis\u001b[38;5;241m=\u001b[39m\u001b[38;5;28;01mNone\u001b[39;00m, out\u001b[38;5;241m=\u001b[39m\u001b[38;5;28;01mNone\u001b[39;00m, keepdims\u001b[38;5;241m=\u001b[39mnp\u001b[38;5;241m.\u001b[39m_NoValue, initial\u001b[38;5;241m=\u001b[39mnp\u001b[38;5;241m.\u001b[39m_NoValue,\n\u001b[0;32m   2831\u001b[0m          where\u001b[38;5;241m=\u001b[39mnp\u001b[38;5;241m.\u001b[39m_NoValue):\n\u001b[0;32m   2832\u001b[0m \u001b[38;5;250m    \u001b[39m\u001b[38;5;124;03m\"\"\"\u001b[39;00m\n\u001b[0;32m   2833\u001b[0m \u001b[38;5;124;03m    Return the minimum of an array or minimum along an axis.\u001b[39;00m\n\u001b[0;32m   2834\u001b[0m \n\u001b[1;32m   (...)\u001b[0m\n\u001b[0;32m   2944\u001b[0m \u001b[38;5;124;03m    6\u001b[39;00m\n\u001b[0;32m   2945\u001b[0m \u001b[38;5;124;03m    \"\"\"\u001b[39;00m\n\u001b[1;32m-> 2946\u001b[0m     \u001b[38;5;28;01mreturn\u001b[39;00m \u001b[43m_wrapreduction\u001b[49m\u001b[43m(\u001b[49m\u001b[43ma\u001b[49m\u001b[43m,\u001b[49m\u001b[43m \u001b[49m\u001b[43mnp\u001b[49m\u001b[38;5;241;43m.\u001b[39;49m\u001b[43mminimum\u001b[49m\u001b[43m,\u001b[49m\u001b[43m \u001b[49m\u001b[38;5;124;43m'\u001b[39;49m\u001b[38;5;124;43mmin\u001b[39;49m\u001b[38;5;124;43m'\u001b[39;49m\u001b[43m,\u001b[49m\u001b[43m \u001b[49m\u001b[43maxis\u001b[49m\u001b[43m,\u001b[49m\u001b[43m \u001b[49m\u001b[38;5;28;43;01mNone\u001b[39;49;00m\u001b[43m,\u001b[49m\u001b[43m \u001b[49m\u001b[43mout\u001b[49m\u001b[43m,\u001b[49m\n\u001b[0;32m   2947\u001b[0m \u001b[43m                          \u001b[49m\u001b[43mkeepdims\u001b[49m\u001b[38;5;241;43m=\u001b[39;49m\u001b[43mkeepdims\u001b[49m\u001b[43m,\u001b[49m\u001b[43m \u001b[49m\u001b[43minitial\u001b[49m\u001b[38;5;241;43m=\u001b[39;49m\u001b[43minitial\u001b[49m\u001b[43m,\u001b[49m\u001b[43m \u001b[49m\u001b[43mwhere\u001b[49m\u001b[38;5;241;43m=\u001b[39;49m\u001b[43mwhere\u001b[49m\u001b[43m)\u001b[49m\n",
      "File \u001b[1;32mD:\\miniconda3\\envs\\pydata-book\\lib\\site-packages\\numpy\\core\\fromnumeric.py:86\u001b[0m, in \u001b[0;36m_wrapreduction\u001b[1;34m(obj, ufunc, method, axis, dtype, out, **kwargs)\u001b[0m\n\u001b[0;32m     83\u001b[0m         \u001b[38;5;28;01melse\u001b[39;00m:\n\u001b[0;32m     84\u001b[0m             \u001b[38;5;28;01mreturn\u001b[39;00m reduction(axis\u001b[38;5;241m=\u001b[39maxis, out\u001b[38;5;241m=\u001b[39mout, \u001b[38;5;241m*\u001b[39m\u001b[38;5;241m*\u001b[39mpasskwargs)\n\u001b[1;32m---> 86\u001b[0m \u001b[38;5;28;01mreturn\u001b[39;00m \u001b[43mufunc\u001b[49m\u001b[38;5;241;43m.\u001b[39;49m\u001b[43mreduce\u001b[49m\u001b[43m(\u001b[49m\u001b[43mobj\u001b[49m\u001b[43m,\u001b[49m\u001b[43m \u001b[49m\u001b[43maxis\u001b[49m\u001b[43m,\u001b[49m\u001b[43m \u001b[49m\u001b[43mdtype\u001b[49m\u001b[43m,\u001b[49m\u001b[43m \u001b[49m\u001b[43mout\u001b[49m\u001b[43m,\u001b[49m\u001b[43m \u001b[49m\u001b[38;5;241;43m*\u001b[39;49m\u001b[38;5;241;43m*\u001b[39;49m\u001b[43mpasskwargs\u001b[49m\u001b[43m)\u001b[49m\n",
      "\u001b[1;31mTypeError\u001b[0m: 'str' object cannot be interpreted as an integer"
     ]
    }
   ],
   "source": [
    "np.min(matrix, axis=\"column\")"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 103,
   "id": "c92e70b3",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "array([  8,  55, 158,   0], dtype=int64)"
      ]
     },
     "execution_count": 103,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "np.min(matrix, axis=0)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 104,
   "id": "9d2a64b5",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "(14, 4)"
      ]
     },
     "execution_count": 104,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "matrix.shape"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 105,
   "id": "b85b72f3",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "array([  8,  55, 158,   0], dtype=int64)"
      ]
     },
     "execution_count": 105,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "np.min(matrix, axis=0)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 106,
   "id": "33115d10",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "(4,)"
      ]
     },
     "execution_count": 106,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "np.min(matrix, axis=0).shape"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 107,
   "id": "799ceb73",
   "metadata": {},
   "outputs": [],
   "source": [
    "min_vals = np.min(matrix, axis=0)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 108,
   "id": "fd6501b8",
   "metadata": {},
   "outputs": [],
   "source": [
    "max_vals = np.max(matrix, axis=0)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 109,
   "id": "80253aa0",
   "metadata": {},
   "outputs": [],
   "source": [
    "range_vals = max_vals - min_vals"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 110,
   "id": "42d10b17",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "array([], dtype=int64)"
      ]
     },
     "execution_count": 110,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "range_vals[range_vals == 0]"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 111,
   "id": "36e5c7b4",
   "metadata": {},
   "outputs": [],
   "source": [
    "range_vals[range_vals == 0] = 1"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 112,
   "id": "d6373387",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "array([  8,  55, 158,   0], dtype=int64)"
      ]
     },
     "execution_count": 112,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "min_vals"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 113,
   "id": "809b827b",
   "metadata": {
    "collapsed": true
   },
   "outputs": [
    {
     "ename": "NameError",
     "evalue": "name 'matric' is not defined",
     "output_type": "error",
     "traceback": [
      "\u001b[1;31m---------------------------------------------------------------------------\u001b[0m",
      "\u001b[1;31mNameError\u001b[0m                                 Traceback (most recent call last)",
      "Cell \u001b[1;32mIn[113], line 1\u001b[0m\n\u001b[1;32m----> 1\u001b[0m \u001b[43mmatric\u001b[49m\n",
      "\u001b[1;31mNameError\u001b[0m: name 'matric' is not defined"
     ]
    }
   ],
   "source": [
    "matric"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 114,
   "id": "77d4d211",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "array([[ 25,  77, 175,  10],\n",
       "       [ 31, 110, 195,  12],\n",
       "       [ 15,  70, 172,   2],\n",
       "       [ 20,  85, 180,  16],\n",
       "       [ 10,  65, 168,   0],\n",
       "       [ 12,  75, 173,   6],\n",
       "       [ 16,  75, 180,   3],\n",
       "       [ 26,  63, 165,   2],\n",
       "       [ 15,  55, 158,   5],\n",
       "       [ 21,  66, 163,  14],\n",
       "       [ 30,  95, 190,   1],\n",
       "       [ 13,  72, 172,  11],\n",
       "       [  8,  83, 185,   3],\n",
       "       [ 12, 115, 192,  15]], dtype=int64)"
      ]
     },
     "execution_count": 114,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "matrix"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 115,
   "id": "7bab25cf",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "array([[17, 22, 17, 10],\n",
       "       [23, 55, 37, 12],\n",
       "       [ 7, 15, 14,  2],\n",
       "       [12, 30, 22, 16],\n",
       "       [ 2, 10, 10,  0],\n",
       "       [ 4, 20, 15,  6],\n",
       "       [ 8, 20, 22,  3],\n",
       "       [18,  8,  7,  2],\n",
       "       [ 7,  0,  0,  5],\n",
       "       [13, 11,  5, 14],\n",
       "       [22, 40, 32,  1],\n",
       "       [ 5, 17, 14, 11],\n",
       "       [ 0, 28, 27,  3],\n",
       "       [ 4, 60, 34, 15]], dtype=int64)"
      ]
     },
     "execution_count": 115,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "matrix - min_vals"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 116,
   "id": "9d2e6dcd",
   "metadata": {
    "collapsed": true
   },
   "outputs": [
    {
     "ename": "NameError",
     "evalue": "name 'maxtrix' is not defined",
     "output_type": "error",
     "traceback": [
      "\u001b[1;31m---------------------------------------------------------------------------\u001b[0m",
      "\u001b[1;31mNameError\u001b[0m                                 Traceback (most recent call last)",
      "Cell \u001b[1;32mIn[116], line 1\u001b[0m\n\u001b[1;32m----> 1\u001b[0m (\u001b[43mmaxtrix\u001b[49m \u001b[38;5;241m-\u001b[39m min_vals) \u001b[38;5;241m/\u001b[39m range_vals\n",
      "\u001b[1;31mNameError\u001b[0m: name 'maxtrix' is not defined"
     ]
    }
   ],
   "source": [
    "(maxtrix - min_vals) / range_vals"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 117,
   "id": "8c9bca8d",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "array([[0.73913043, 0.36666667, 0.45945946, 0.625     ],\n",
       "       [1.        , 0.91666667, 1.        , 0.75      ],\n",
       "       [0.30434783, 0.25      , 0.37837838, 0.125     ],\n",
       "       [0.52173913, 0.5       , 0.59459459, 1.        ],\n",
       "       [0.08695652, 0.16666667, 0.27027027, 0.        ],\n",
       "       [0.17391304, 0.33333333, 0.40540541, 0.375     ],\n",
       "       [0.34782609, 0.33333333, 0.59459459, 0.1875    ],\n",
       "       [0.7826087 , 0.13333333, 0.18918919, 0.125     ],\n",
       "       [0.30434783, 0.        , 0.        , 0.3125    ],\n",
       "       [0.56521739, 0.18333333, 0.13513514, 0.875     ],\n",
       "       [0.95652174, 0.66666667, 0.86486486, 0.0625    ],\n",
       "       [0.2173913 , 0.28333333, 0.37837838, 0.6875    ],\n",
       "       [0.        , 0.46666667, 0.72972973, 0.1875    ],\n",
       "       [0.17391304, 1.        , 0.91891892, 0.9375    ]])"
      ]
     },
     "execution_count": 117,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "(matrix - min_vals) / range_vals"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 118,
   "id": "55ea08b7",
   "metadata": {},
   "outputs": [
    {
     "ename": "NameError",
     "evalue": "name 'maxtrix' is not defined",
     "output_type": "error",
     "traceback": [
      "\u001b[1;31m---------------------------------------------------------------------------\u001b[0m",
      "\u001b[1;31mNameError\u001b[0m                                 Traceback (most recent call last)",
      "Cell \u001b[1;32mIn[118], line 1\u001b[0m\n\u001b[1;32m----> 1\u001b[0m min_max_matrix \u001b[38;5;241m=\u001b[39m (\u001b[43mmaxtrix\u001b[49m \u001b[38;5;241m-\u001b[39m min_vals) \u001b[38;5;241m/\u001b[39m range_vals\n",
      "\u001b[1;31mNameError\u001b[0m: name 'maxtrix' is not defined"
     ]
    }
   ],
   "source": [
    "min_max_matrix = (maxtrix - min_vals) / range_vals"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 119,
   "id": "a2229453",
   "metadata": {},
   "outputs": [],
   "source": [
    "min_max_matrix = (matrix - min_vals) / range_vals"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 120,
   "id": "61223392",
   "metadata": {
    "collapsed": true
   },
   "outputs": [
    {
     "data": {
      "text/plain": [
       "array([[0.73913043, 0.36666667, 0.45945946, 0.625     ],\n",
       "       [1.        , 0.91666667, 1.        , 0.75      ],\n",
       "       [0.30434783, 0.25      , 0.37837838, 0.125     ],\n",
       "       [0.52173913, 0.5       , 0.59459459, 1.        ],\n",
       "       [0.08695652, 0.16666667, 0.27027027, 0.        ],\n",
       "       [0.17391304, 0.33333333, 0.40540541, 0.375     ],\n",
       "       [0.34782609, 0.33333333, 0.59459459, 0.1875    ],\n",
       "       [0.7826087 , 0.13333333, 0.18918919, 0.125     ],\n",
       "       [0.30434783, 0.        , 0.        , 0.3125    ],\n",
       "       [0.56521739, 0.18333333, 0.13513514, 0.875     ],\n",
       "       [0.95652174, 0.66666667, 0.86486486, 0.0625    ],\n",
       "       [0.2173913 , 0.28333333, 0.37837838, 0.6875    ],\n",
       "       [0.        , 0.46666667, 0.72972973, 0.1875    ],\n",
       "       [0.17391304, 1.        , 0.91891892, 0.9375    ]])"
      ]
     },
     "execution_count": 120,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "min_max_matrix"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 121,
   "id": "81af76a0",
   "metadata": {
    "collapsed": true
   },
   "outputs": [
    {
     "data": {
      "text/plain": [
       "array([[4.08695652, 2.7942029 , 3.35957697, 2.96195652],\n",
       "       [2.7942029 , 3.33111111, 3.84864865, 3.07395833],\n",
       "       [3.35957697, 3.84864865, 4.62089116, 3.39695946],\n",
       "       [2.96195652, 3.07395833, 3.39695946, 4.4140625 ]])"
      ]
     },
     "execution_count": 121,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "min_max_matrix.T.dot(min_max_matrix)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 122,
   "id": "6e09ab29",
   "metadata": {
    "collapsed": true
   },
   "outputs": [
    {
     "ename": "NameError",
     "evalue": "name 'maxtrix' is not defined",
     "output_type": "error",
     "traceback": [
      "\u001b[1;31m---------------------------------------------------------------------------\u001b[0m",
      "\u001b[1;31mNameError\u001b[0m                                 Traceback (most recent call last)",
      "Cell \u001b[1;32mIn[122], line 1\u001b[0m\n\u001b[1;32m----> 1\u001b[0m \u001b[43mmaxtrix\u001b[49m\u001b[38;5;241m.\u001b[39mT\u001b[38;5;241m.\u001b[39mdot(maxtrix)\n",
      "\u001b[1;31mNameError\u001b[0m: name 'maxtrix' is not defined"
     ]
    }
   ],
   "source": [
    "maxtrix.T.dot(maxtrix)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 123,
   "id": "50fe08e9",
   "metadata": {
    "collapsed": true
   },
   "outputs": [
    {
     "ename": "NameError",
     "evalue": "name 'maxtric' is not defined",
     "output_type": "error",
     "traceback": [
      "\u001b[1;31m---------------------------------------------------------------------------\u001b[0m",
      "\u001b[1;31mNameError\u001b[0m                                 Traceback (most recent call last)",
      "Cell \u001b[1;32mIn[123], line 1\u001b[0m\n\u001b[1;32m----> 1\u001b[0m \u001b[43mmaxtric\u001b[49m\u001b[38;5;241m.\u001b[39mT\u001b[38;5;241m.\u001b[39mdot(maxtric)\n",
      "\u001b[1;31mNameError\u001b[0m: name 'maxtric' is not defined"
     ]
    }
   ],
   "source": [
    "maxtric.T.dot(maxtric)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 124,
   "id": "785732fa",
   "metadata": {
    "collapsed": true
   },
   "outputs": [
    {
     "data": {
      "text/plain": [
       "array([[  5330,  20514,  45039,   1890],\n",
       "       [ 20514,  91302, 197372,   8451],\n",
       "       [ 45039, 197372, 436718,  17811],\n",
       "       [  1890,   8451,  17811,   1130]], dtype=int64)"
      ]
     },
     "execution_count": 124,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "matrix.T.dot(matrix)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 125,
   "id": "d4e1d55f",
   "metadata": {
    "collapsed": true
   },
   "outputs": [
    {
     "data": {
      "text/plain": [
       "array([[ 25,  77, 175,  10],\n",
       "       [ 31, 110, 195,  12],\n",
       "       [ 15,  70, 172,   2],\n",
       "       [ 20,  85, 180,  16],\n",
       "       [ 10,  65, 168,   0],\n",
       "       [ 12,  75, 173,   6],\n",
       "       [ 16,  75, 180,   3],\n",
       "       [ 26,  63, 165,   2],\n",
       "       [ 15,  55, 158,   5],\n",
       "       [ 21,  66, 163,  14],\n",
       "       [ 30,  95, 190,   1],\n",
       "       [ 13,  72, 172,  11],\n",
       "       [  8,  83, 185,   3],\n",
       "       [ 12, 115, 192,  15]], dtype=int64)"
      ]
     },
     "execution_count": 125,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "matrix"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 126,
   "id": "ee4eb502",
   "metadata": {},
   "outputs": [],
   "source": [
    "cov_matrix = np.cov(matrix, rowvar=False)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 127,
   "id": "b9a957ef",
   "metadata": {
    "collapsed": true
   },
   "outputs": [
    {
     "data": {
      "text/plain": [
       "array([[ 55.51648352,  34.46153846,  20.18681319,   5.82417582],\n",
       "       [ 34.46153846, 302.15384615, 184.61538462,  42.38461538],\n",
       "       [ 20.18681319, 184.61538462, 126.52747253,  14.03296703],\n",
       "       [  5.82417582,  42.38461538,  14.03296703,  31.97802198]])"
      ]
     },
     "execution_count": 127,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "cov_matrix"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 128,
   "id": "263291e6",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "array([[  1332.5 ,   5128.5 ,  11259.75,    472.5 ],\n",
       "       [  5128.5 ,  22825.5 ,  49343.  ,   2112.75],\n",
       "       [ 11259.75,  49343.  , 109179.5 ,   4452.75],\n",
       "       [   472.5 ,   2112.75,   4452.75,    282.5 ]])"
      ]
     },
     "execution_count": 128,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "matrix.T.dot(matrix) / matrix.shape[1]"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 129,
   "id": "c8ebf2c0",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "array([[  5330,  20514,  45039,   1890],\n",
       "       [ 20514,  91302, 197372,   8451],\n",
       "       [ 45039, 197372, 436718,  17811],\n",
       "       [  1890,   8451,  17811,   1130]], dtype=int64)"
      ]
     },
     "execution_count": 129,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "matrix.T.dot(matrix)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 130,
   "id": "de590672",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "array([[  380.71428571,  1465.28571429,  3217.07142857,   135.        ],\n",
       "       [ 1465.28571429,  6521.57142857, 14098.        ,   603.64285714],\n",
       "       [ 3217.07142857, 14098.        , 31194.14285714,  1272.21428571],\n",
       "       [  135.        ,   603.64285714,  1272.21428571,    80.71428571]])"
      ]
     },
     "execution_count": 130,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "matrix.T.dot(matrix) / matrix.shape[0]"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 131,
   "id": "a7a2a0fd",
   "metadata": {
    "collapsed": true
   },
   "outputs": [
    {
     "data": {
      "text/plain": [
       "array([[ 25,  77, 175,  10],\n",
       "       [ 31, 110, 195,  12],\n",
       "       [ 15,  70, 172,   2],\n",
       "       [ 20,  85, 180,  16],\n",
       "       [ 10,  65, 168,   0],\n",
       "       [ 12,  75, 173,   6],\n",
       "       [ 16,  75, 180,   3],\n",
       "       [ 26,  63, 165,   2],\n",
       "       [ 15,  55, 158,   5],\n",
       "       [ 21,  66, 163,  14],\n",
       "       [ 30,  95, 190,   1],\n",
       "       [ 13,  72, 172,  11],\n",
       "       [  8,  83, 185,   3],\n",
       "       [ 12, 115, 192,  15]], dtype=int64)"
      ]
     },
     "execution_count": 131,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "matrix"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 132,
   "id": "0c720a67",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "array([[0.10494609, 0.02497213, 0.02372128, 0.01582656],\n",
       "       [0.02497213, 0.08393162, 0.08316008, 0.04415064],\n",
       "       [0.02372128, 0.08316008, 0.09242328, 0.02370434],\n",
       "       [0.01582656, 0.04415064, 0.02370434, 0.12491415]])"
      ]
     },
     "execution_count": 132,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "np.cov(min_max_matrix, rowvar=False)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 133,
   "id": "3040c563",
   "metadata": {
    "collapsed": true
   },
   "outputs": [
    {
     "data": {
      "text/plain": [
       "array([[0.73913043, 0.36666667, 0.45945946, 0.625     ],\n",
       "       [1.        , 0.91666667, 1.        , 0.75      ],\n",
       "       [0.30434783, 0.25      , 0.37837838, 0.125     ],\n",
       "       [0.52173913, 0.5       , 0.59459459, 1.        ],\n",
       "       [0.08695652, 0.16666667, 0.27027027, 0.        ],\n",
       "       [0.17391304, 0.33333333, 0.40540541, 0.375     ],\n",
       "       [0.34782609, 0.33333333, 0.59459459, 0.1875    ],\n",
       "       [0.7826087 , 0.13333333, 0.18918919, 0.125     ],\n",
       "       [0.30434783, 0.        , 0.        , 0.3125    ],\n",
       "       [0.56521739, 0.18333333, 0.13513514, 0.875     ],\n",
       "       [0.95652174, 0.66666667, 0.86486486, 0.0625    ],\n",
       "       [0.2173913 , 0.28333333, 0.37837838, 0.6875    ],\n",
       "       [0.        , 0.46666667, 0.72972973, 0.1875    ],\n",
       "       [0.17391304, 1.        , 0.91891892, 0.9375    ]])"
      ]
     },
     "execution_count": 133,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "min_max_matrix"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 134,
   "id": "c3611716",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "array([[ 25,  77, 175,  10],\n",
       "       [ 31, 110, 195,  12],\n",
       "       [ 15,  70, 172,   2],\n",
       "       [ 20,  85, 180,  16],\n",
       "       [ 10,  65, 168,   0],\n",
       "       [ 12,  75, 173,   6],\n",
       "       [ 16,  75, 180,   3],\n",
       "       [ 26,  63, 165,   2],\n",
       "       [ 15,  55, 158,   5],\n",
       "       [ 21,  66, 163,  14],\n",
       "       [ 30,  95, 190,   1],\n",
       "       [ 13,  72, 172,  11],\n",
       "       [  8,  83, 185,   3],\n",
       "       [ 12, 115, 192,  15]], dtype=int64)"
      ]
     },
     "execution_count": 134,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "matrix\n"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 135,
   "id": "3f9d6d85",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "array([ 18.14285714,  79.        , 176.28571429,   7.14285714])"
      ]
     },
     "execution_count": 135,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "np.mean(matrix, axis=0)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 136,
   "id": "fdadb31d",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "array([[  6.85714286,  -2.        ,  -1.28571429,   2.85714286],\n",
       "       [ 12.85714286,  31.        ,  18.71428571,   4.85714286],\n",
       "       [ -3.14285714,  -9.        ,  -4.28571429,  -5.14285714],\n",
       "       [  1.85714286,   6.        ,   3.71428571,   8.85714286],\n",
       "       [ -8.14285714, -14.        ,  -8.28571429,  -7.14285714],\n",
       "       [ -6.14285714,  -4.        ,  -3.28571429,  -1.14285714],\n",
       "       [ -2.14285714,  -4.        ,   3.71428571,  -4.14285714],\n",
       "       [  7.85714286, -16.        , -11.28571429,  -5.14285714],\n",
       "       [ -3.14285714, -24.        , -18.28571429,  -2.14285714],\n",
       "       [  2.85714286, -13.        , -13.28571429,   6.85714286],\n",
       "       [ 11.85714286,  16.        ,  13.71428571,  -6.14285714],\n",
       "       [ -5.14285714,  -7.        ,  -4.28571429,   3.85714286],\n",
       "       [-10.14285714,   4.        ,   8.71428571,  -4.14285714],\n",
       "       [ -6.14285714,  36.        ,  15.71428571,   7.85714286]])"
      ]
     },
     "execution_count": 136,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "matrix - np.mean(matrix, axis=0)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 137,
   "id": "de9084f5",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "array([[ 25,  77, 175,  10],\n",
       "       [ 31, 110, 195,  12],\n",
       "       [ 15,  70, 172,   2],\n",
       "       [ 20,  85, 180,  16],\n",
       "       [ 10,  65, 168,   0],\n",
       "       [ 12,  75, 173,   6],\n",
       "       [ 16,  75, 180,   3],\n",
       "       [ 26,  63, 165,   2],\n",
       "       [ 15,  55, 158,   5],\n",
       "       [ 21,  66, 163,  14],\n",
       "       [ 30,  95, 190,   1],\n",
       "       [ 13,  72, 172,  11],\n",
       "       [  8,  83, 185,   3],\n",
       "       [ 12, 115, 192,  15]], dtype=int64)"
      ]
     },
     "execution_count": 137,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "matrix"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 138,
   "id": "fa571a16",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "array([[ 25,  31,  15,  20,  10,  12,  16,  26,  15,  21,  30,  13,   8,\n",
       "         12],\n",
       "       [ 77, 110,  70,  85,  65,  75,  75,  63,  55,  66,  95,  72,  83,\n",
       "        115],\n",
       "       [175, 195, 172, 180, 168, 173, 180, 165, 158, 163, 190, 172, 185,\n",
       "        192],\n",
       "       [ 10,  12,   2,  16,   0,   6,   3,   2,   5,  14,   1,  11,   3,\n",
       "         15]], dtype=int64)"
      ]
     },
     "execution_count": 138,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "matrix.T"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 139,
   "id": "ad2fdec9",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "(4, 14)"
      ]
     },
     "execution_count": 139,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "matrix.T.shape"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 140,
   "id": "cd3d50ee",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "array([[  5330,  20514,  45039,   1890],\n",
       "       [ 20514,  91302, 197372,   8451],\n",
       "       [ 45039, 197372, 436718,  17811],\n",
       "       [  1890,   8451,  17811,   1130]], dtype=int64)"
      ]
     },
     "execution_count": 140,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "matrix.T.dot(matrix)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 141,
   "id": "fd33231a",
   "metadata": {},
   "outputs": [],
   "source": [
    "centered = matrix - np.mean(matrix, axis=0)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 142,
   "id": "d21d51ed",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "array([[  6.85714286,  -2.        ,  -1.28571429,   2.85714286],\n",
       "       [ 12.85714286,  31.        ,  18.71428571,   4.85714286],\n",
       "       [ -3.14285714,  -9.        ,  -4.28571429,  -5.14285714],\n",
       "       [  1.85714286,   6.        ,   3.71428571,   8.85714286],\n",
       "       [ -8.14285714, -14.        ,  -8.28571429,  -7.14285714],\n",
       "       [ -6.14285714,  -4.        ,  -3.28571429,  -1.14285714],\n",
       "       [ -2.14285714,  -4.        ,   3.71428571,  -4.14285714],\n",
       "       [  7.85714286, -16.        , -11.28571429,  -5.14285714],\n",
       "       [ -3.14285714, -24.        , -18.28571429,  -2.14285714],\n",
       "       [  2.85714286, -13.        , -13.28571429,   6.85714286],\n",
       "       [ 11.85714286,  16.        ,  13.71428571,  -6.14285714],\n",
       "       [ -5.14285714,  -7.        ,  -4.28571429,   3.85714286],\n",
       "       [-10.14285714,   4.        ,   8.71428571,  -4.14285714],\n",
       "       [ -6.14285714,  36.        ,  15.71428571,   7.85714286]])"
      ]
     },
     "execution_count": 142,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "centered"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 143,
   "id": "23a522cd",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "array([[  6.85714286,  12.85714286,  -3.14285714,   1.85714286,\n",
       "         -8.14285714,  -6.14285714,  -2.14285714,   7.85714286,\n",
       "         -3.14285714,   2.85714286,  11.85714286,  -5.14285714,\n",
       "        -10.14285714,  -6.14285714],\n",
       "       [ -2.        ,  31.        ,  -9.        ,   6.        ,\n",
       "        -14.        ,  -4.        ,  -4.        , -16.        ,\n",
       "        -24.        , -13.        ,  16.        ,  -7.        ,\n",
       "          4.        ,  36.        ],\n",
       "       [ -1.28571429,  18.71428571,  -4.28571429,   3.71428571,\n",
       "         -8.28571429,  -3.28571429,   3.71428571, -11.28571429,\n",
       "        -18.28571429, -13.28571429,  13.71428571,  -4.28571429,\n",
       "          8.71428571,  15.71428571],\n",
       "       [  2.85714286,   4.85714286,  -5.14285714,   8.85714286,\n",
       "         -7.14285714,  -1.14285714,  -4.14285714,  -5.14285714,\n",
       "         -2.14285714,   6.85714286,  -6.14285714,   3.85714286,\n",
       "         -4.14285714,   7.85714286]])"
      ]
     },
     "execution_count": 143,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "centered.T"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 144,
   "id": "bebf1c43",
   "metadata": {},
   "outputs": [
    {
     "ename": "NameError",
     "evalue": "name 'n' is not defined",
     "output_type": "error",
     "traceback": [
      "\u001b[1;31m---------------------------------------------------------------------------\u001b[0m",
      "\u001b[1;31mNameError\u001b[0m                                 Traceback (most recent call last)",
      "Cell \u001b[1;32mIn[144], line 1\u001b[0m\n\u001b[1;32m----> 1\u001b[0m centered\u001b[38;5;241m.\u001b[39mT\u001b[38;5;241m.\u001b[39mdot(centered) \u001b[38;5;241m/\u001b[39m (\u001b[43mn\u001b[49m\u001b[38;5;241m-\u001b[39m\u001b[38;5;241m1\u001b[39m)\n",
      "\u001b[1;31mNameError\u001b[0m: name 'n' is not defined"
     ]
    }
   ],
   "source": [
    "centered.T.dot(centered) / (n-1)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 145,
   "id": "26576128",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "array([[ 55.51648352,  34.46153846,  20.18681319,   5.82417582],\n",
       "       [ 34.46153846, 302.15384615, 184.61538462,  42.38461538],\n",
       "       [ 20.18681319, 184.61538462, 126.52747253,  14.03296703],\n",
       "       [  5.82417582,  42.38461538,  14.03296703,  31.97802198]])"
      ]
     },
     "execution_count": 145,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "centered.T.dot(centered) / (matrix.shape[0] - 1)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 146,
   "id": "909c4176",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "array([[ 721.71428571,  448.        ,  262.42857143,   75.71428571],\n",
       "       [ 448.        , 3928.        , 2400.        ,  551.        ],\n",
       "       [ 262.42857143, 2400.        , 1644.85714286,  182.42857143],\n",
       "       [  75.71428571,  551.        ,  182.42857143,  415.71428571]])"
      ]
     },
     "execution_count": 146,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "centered.T.dot(centered)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 147,
   "id": "6381e47d",
   "metadata": {},
   "outputs": [],
   "source": [
    "temp_1 = np.array([  6.85714286,  12.85714286,  -3.14285714,   1.85714286,\n",
    "         -8.14285714,  -6.14285714,  -2.14285714,   7.85714286,\n",
    "         -3.14285714,   2.85714286,  11.85714286,  -5.14285714,\n",
    "        -10.14285714,  -6.14285714])"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 148,
   "id": "13b826d7",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "array([  6.85714286,  12.85714286,  -3.14285714,   1.85714286,\n",
       "        -8.14285714,  -6.14285714,  -2.14285714,   7.85714286,\n",
       "        -3.14285714,   2.85714286,  11.85714286,  -5.14285714,\n",
       "       -10.14285714,  -6.14285714])"
      ]
     },
     "execution_count": 148,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "temp_1"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 149,
   "id": "5f024e4b",
   "metadata": {},
   "outputs": [],
   "source": [
    "temp_2 = np.array([[[  6.85714286,  12.85714286,  -3.14285714,   1.85714286,\n",
    "         -8.14285714,  -6.14285714,  -2.14285714,   7.85714286,\n",
    "         -3.14285714,   2.85714286,  11.85714286,  -5.14285714,\n",
    "        -10.14285714,  -6.14285714]]]).T"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 150,
   "id": "1a57c41e",
   "metadata": {
    "collapsed": true
   },
   "outputs": [
    {
     "ename": "NameError",
     "evalue": "name 'temp2' is not defined",
     "output_type": "error",
     "traceback": [
      "\u001b[1;31m---------------------------------------------------------------------------\u001b[0m",
      "\u001b[1;31mNameError\u001b[0m                                 Traceback (most recent call last)",
      "Cell \u001b[1;32mIn[150], line 1\u001b[0m\n\u001b[1;32m----> 1\u001b[0m \u001b[43mtemp2\u001b[49m\n",
      "\u001b[1;31mNameError\u001b[0m: name 'temp2' is not defined"
     ]
    }
   ],
   "source": [
    "temp2"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 151,
   "id": "f1d71fe1",
   "metadata": {
    "collapsed": true
   },
   "outputs": [
    {
     "data": {
      "text/plain": [
       "array([[[  6.85714286]],\n",
       "\n",
       "       [[ 12.85714286]],\n",
       "\n",
       "       [[ -3.14285714]],\n",
       "\n",
       "       [[  1.85714286]],\n",
       "\n",
       "       [[ -8.14285714]],\n",
       "\n",
       "       [[ -6.14285714]],\n",
       "\n",
       "       [[ -2.14285714]],\n",
       "\n",
       "       [[  7.85714286]],\n",
       "\n",
       "       [[ -3.14285714]],\n",
       "\n",
       "       [[  2.85714286]],\n",
       "\n",
       "       [[ 11.85714286]],\n",
       "\n",
       "       [[ -5.14285714]],\n",
       "\n",
       "       [[-10.14285714]],\n",
       "\n",
       "       [[ -6.14285714]]])"
      ]
     },
     "execution_count": 151,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "temp_2"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 152,
   "id": "be13b8af",
   "metadata": {
    "collapsed": true
   },
   "outputs": [
    {
     "data": {
      "text/plain": [
       "(array([  6.85714286,  12.85714286,  -3.14285714,   1.85714286,\n",
       "         -8.14285714,  -6.14285714,  -2.14285714,   7.85714286,\n",
       "         -3.14285714,   2.85714286,  11.85714286,  -5.14285714,\n",
       "        -10.14285714,  -6.14285714]),\n",
       " array([[[  6.85714286]],\n",
       " \n",
       "        [[ 12.85714286]],\n",
       " \n",
       "        [[ -3.14285714]],\n",
       " \n",
       "        [[  1.85714286]],\n",
       " \n",
       "        [[ -8.14285714]],\n",
       " \n",
       "        [[ -6.14285714]],\n",
       " \n",
       "        [[ -2.14285714]],\n",
       " \n",
       "        [[  7.85714286]],\n",
       " \n",
       "        [[ -3.14285714]],\n",
       " \n",
       "        [[  2.85714286]],\n",
       " \n",
       "        [[ 11.85714286]],\n",
       " \n",
       "        [[ -5.14285714]],\n",
       " \n",
       "        [[-10.14285714]],\n",
       " \n",
       "        [[ -6.14285714]]]))"
      ]
     },
     "execution_count": 152,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "temp_1,temp_2"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 153,
   "id": "096fa4a9",
   "metadata": {
    "collapsed": true
   },
   "outputs": [
    {
     "ename": "ValueError",
     "evalue": "shapes (14,) and (14,1,1) not aligned: 14 (dim 0) != 1 (dim 1)",
     "output_type": "error",
     "traceback": [
      "\u001b[1;31m---------------------------------------------------------------------------\u001b[0m",
      "\u001b[1;31mValueError\u001b[0m                                Traceback (most recent call last)",
      "Cell \u001b[1;32mIn[153], line 1\u001b[0m\n\u001b[1;32m----> 1\u001b[0m \u001b[43mtemp_1\u001b[49m\u001b[38;5;241;43m.\u001b[39;49m\u001b[43mdot\u001b[49m\u001b[43m(\u001b[49m\u001b[43mtemp_2\u001b[49m\u001b[43m)\u001b[49m\n",
      "\u001b[1;31mValueError\u001b[0m: shapes (14,) and (14,1,1) not aligned: 14 (dim 0) != 1 (dim 1)"
     ]
    }
   ],
   "source": [
    "temp_1.dot(temp_2)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 154,
   "id": "5bcaedee",
   "metadata": {},
   "outputs": [],
   "source": [
    "temp_2 = np.array([  6.85714286,  12.85714286,  -3.14285714,   1.85714286,\n",
    "         -8.14285714,  -6.14285714,  -2.14285714,   7.85714286,\n",
    "         -3.14285714,   2.85714286,  11.85714286,  -5.14285714,\n",
    "        -10.14285714,  -6.14285714]).T"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 155,
   "id": "c01e414f",
   "metadata": {
    "collapsed": true
   },
   "outputs": [
    {
     "data": {
      "text/plain": [
       "(array([  6.85714286,  12.85714286,  -3.14285714,   1.85714286,\n",
       "         -8.14285714,  -6.14285714,  -2.14285714,   7.85714286,\n",
       "         -3.14285714,   2.85714286,  11.85714286,  -5.14285714,\n",
       "        -10.14285714,  -6.14285714]),\n",
       " array([  6.85714286,  12.85714286,  -3.14285714,   1.85714286,\n",
       "         -8.14285714,  -6.14285714,  -2.14285714,   7.85714286,\n",
       "         -3.14285714,   2.85714286,  11.85714286,  -5.14285714,\n",
       "        -10.14285714,  -6.14285714]))"
      ]
     },
     "execution_count": 155,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "temp_1,temp_2"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 156,
   "id": "f8768abf",
   "metadata": {},
   "outputs": [],
   "source": [
    "temp_2 = np.array([[  6.85714286,  12.85714286,  -3.14285714,   1.85714286,\n",
    "         -8.14285714,  -6.14285714,  -2.14285714,   7.85714286,\n",
    "         -3.14285714,   2.85714286,  11.85714286,  -5.14285714,\n",
    "        -10.14285714,  -6.14285714]]).T"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 157,
   "id": "c486a4ae",
   "metadata": {},
   "outputs": [
    {
     "ename": "ValueError",
     "evalue": "shapes (14,1) and (14,) not aligned: 1 (dim 1) != 14 (dim 0)",
     "output_type": "error",
     "traceback": [
      "\u001b[1;31m---------------------------------------------------------------------------\u001b[0m",
      "\u001b[1;31mValueError\u001b[0m                                Traceback (most recent call last)",
      "Cell \u001b[1;32mIn[157], line 1\u001b[0m\n\u001b[1;32m----> 1\u001b[0m \u001b[43mtemp_2\u001b[49m\u001b[38;5;241;43m.\u001b[39;49m\u001b[43mdot\u001b[49m\u001b[43m(\u001b[49m\u001b[43mtemp_1\u001b[49m\u001b[43m)\u001b[49m\n",
      "\u001b[1;31mValueError\u001b[0m: shapes (14,1) and (14,) not aligned: 1 (dim 1) != 14 (dim 0)"
     ]
    }
   ],
   "source": [
    "temp_2.dot(temp_1)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 158,
   "id": "6f4b7f1e",
   "metadata": {
    "collapsed": true
   },
   "outputs": [
    {
     "data": {
      "text/plain": [
       "array([[  6.85714286],\n",
       "       [ 12.85714286],\n",
       "       [ -3.14285714],\n",
       "       [  1.85714286],\n",
       "       [ -8.14285714],\n",
       "       [ -6.14285714],\n",
       "       [ -2.14285714],\n",
       "       [  7.85714286],\n",
       "       [ -3.14285714],\n",
       "       [  2.85714286],\n",
       "       [ 11.85714286],\n",
       "       [ -5.14285714],\n",
       "       [-10.14285714],\n",
       "       [ -6.14285714]])"
      ]
     },
     "execution_count": 158,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "temp_2"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 159,
   "id": "eef1efc3",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "array([  6.85714286,  12.85714286,  -3.14285714,   1.85714286,\n",
       "        -8.14285714,  -6.14285714,  -2.14285714,   7.85714286,\n",
       "        -3.14285714,   2.85714286,  11.85714286,  -5.14285714,\n",
       "       -10.14285714,  -6.14285714])"
      ]
     },
     "execution_count": 159,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "temp_1"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 160,
   "id": "ebbe2337",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "((14,), (14, 1))"
      ]
     },
     "execution_count": 160,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "temp_1.shape,temp_2.shape"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 161,
   "id": "7ee4d14c",
   "metadata": {
    "collapsed": true
   },
   "outputs": [
    {
     "ename": "TypeError",
     "evalue": "array() takes from 1 to 2 positional arguments but 14 were given",
     "output_type": "error",
     "traceback": [
      "\u001b[1;31m---------------------------------------------------------------------------\u001b[0m",
      "\u001b[1;31mTypeError\u001b[0m                                 Traceback (most recent call last)",
      "Cell \u001b[1;32mIn[161], line 1\u001b[0m\n\u001b[1;32m----> 1\u001b[0m temp1 \u001b[38;5;241m=\u001b[39m \u001b[43mnp\u001b[49m\u001b[38;5;241;43m.\u001b[39;49m\u001b[43marray\u001b[49m\u001b[43m(\u001b[49m\u001b[43m  \u001b[49m\u001b[38;5;241;43m6.85714286\u001b[39;49m\u001b[43m,\u001b[49m\u001b[43m  \u001b[49m\u001b[38;5;241;43m12.85714286\u001b[39;49m\u001b[43m,\u001b[49m\u001b[43m  \u001b[49m\u001b[38;5;241;43m-\u001b[39;49m\u001b[38;5;241;43m3.14285714\u001b[39;49m\u001b[43m,\u001b[49m\u001b[43m   \u001b[49m\u001b[38;5;241;43m1.85714286\u001b[39;49m\u001b[43m,\u001b[49m\n\u001b[0;32m      2\u001b[0m \u001b[43m         \u001b[49m\u001b[38;5;241;43m-\u001b[39;49m\u001b[38;5;241;43m8.14285714\u001b[39;49m\u001b[43m,\u001b[49m\u001b[43m  \u001b[49m\u001b[38;5;241;43m-\u001b[39;49m\u001b[38;5;241;43m6.14285714\u001b[39;49m\u001b[43m,\u001b[49m\u001b[43m  \u001b[49m\u001b[38;5;241;43m-\u001b[39;49m\u001b[38;5;241;43m2.14285714\u001b[39;49m\u001b[43m,\u001b[49m\u001b[43m   \u001b[49m\u001b[38;5;241;43m7.85714286\u001b[39;49m\u001b[43m,\u001b[49m\n\u001b[0;32m      3\u001b[0m \u001b[43m         \u001b[49m\u001b[38;5;241;43m-\u001b[39;49m\u001b[38;5;241;43m3.14285714\u001b[39;49m\u001b[43m,\u001b[49m\u001b[43m   \u001b[49m\u001b[38;5;241;43m2.85714286\u001b[39;49m\u001b[43m,\u001b[49m\u001b[43m  \u001b[49m\u001b[38;5;241;43m11.85714286\u001b[39;49m\u001b[43m,\u001b[49m\u001b[43m  \u001b[49m\u001b[38;5;241;43m-\u001b[39;49m\u001b[38;5;241;43m5.14285714\u001b[39;49m\u001b[43m,\u001b[49m\n\u001b[0;32m      4\u001b[0m \u001b[43m        \u001b[49m\u001b[38;5;241;43m-\u001b[39;49m\u001b[38;5;241;43m10.14285714\u001b[39;49m\u001b[43m,\u001b[49m\u001b[43m  \u001b[49m\u001b[38;5;241;43m-\u001b[39;49m\u001b[38;5;241;43m6.14285714\u001b[39;49m\u001b[43m)\u001b[49m\n",
      "\u001b[1;31mTypeError\u001b[0m: array() takes from 1 to 2 positional arguments but 14 were given"
     ]
    }
   ],
   "source": [
    "temp1 = np.array(  6.85714286,  12.85714286,  -3.14285714,   1.85714286,\n",
    "         -8.14285714,  -6.14285714,  -2.14285714,   7.85714286,\n",
    "         -3.14285714,   2.85714286,  11.85714286,  -5.14285714,\n",
    "        -10.14285714,  -6.14285714)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 162,
   "id": "95ac8d5a",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "array([[  6.85714286,  -2.        ,  -1.28571429,   2.85714286],\n",
       "       [ 12.85714286,  31.        ,  18.71428571,   4.85714286],\n",
       "       [ -3.14285714,  -9.        ,  -4.28571429,  -5.14285714],\n",
       "       [  1.85714286,   6.        ,   3.71428571,   8.85714286],\n",
       "       [ -8.14285714, -14.        ,  -8.28571429,  -7.14285714],\n",
       "       [ -6.14285714,  -4.        ,  -3.28571429,  -1.14285714],\n",
       "       [ -2.14285714,  -4.        ,   3.71428571,  -4.14285714],\n",
       "       [  7.85714286, -16.        , -11.28571429,  -5.14285714],\n",
       "       [ -3.14285714, -24.        , -18.28571429,  -2.14285714],\n",
       "       [  2.85714286, -13.        , -13.28571429,   6.85714286],\n",
       "       [ 11.85714286,  16.        ,  13.71428571,  -6.14285714],\n",
       "       [ -5.14285714,  -7.        ,  -4.28571429,   3.85714286],\n",
       "       [-10.14285714,   4.        ,   8.71428571,  -4.14285714],\n",
       "       [ -6.14285714,  36.        ,  15.71428571,   7.85714286]])"
      ]
     },
     "execution_count": 162,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "centered"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 163,
   "id": "f1b53ae5",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "((14, 4), (4, 14))"
      ]
     },
     "execution_count": 163,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "centered.shape,centered.T.shape"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 164,
   "id": "65776493",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "array([[ 721.71428571,  448.        ,  262.42857143,   75.71428571],\n",
       "       [ 448.        , 3928.        , 2400.        ,  551.        ],\n",
       "       [ 262.42857143, 2400.        , 1644.85714286,  182.42857143],\n",
       "       [  75.71428571,  551.        ,  182.42857143,  415.71428571]])"
      ]
     },
     "execution_count": 164,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "centered.T.dot(centered)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 165,
   "id": "e8db8e63",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "array([[  6.85714286,  12.85714286,  -3.14285714,   1.85714286,\n",
       "         -8.14285714,  -6.14285714,  -2.14285714,   7.85714286,\n",
       "         -3.14285714,   2.85714286,  11.85714286,  -5.14285714,\n",
       "        -10.14285714,  -6.14285714],\n",
       "       [ -2.        ,  31.        ,  -9.        ,   6.        ,\n",
       "        -14.        ,  -4.        ,  -4.        , -16.        ,\n",
       "        -24.        , -13.        ,  16.        ,  -7.        ,\n",
       "          4.        ,  36.        ],\n",
       "       [ -1.28571429,  18.71428571,  -4.28571429,   3.71428571,\n",
       "         -8.28571429,  -3.28571429,   3.71428571, -11.28571429,\n",
       "        -18.28571429, -13.28571429,  13.71428571,  -4.28571429,\n",
       "          8.71428571,  15.71428571],\n",
       "       [  2.85714286,   4.85714286,  -5.14285714,   8.85714286,\n",
       "         -7.14285714,  -1.14285714,  -4.14285714,  -5.14285714,\n",
       "         -2.14285714,   6.85714286,  -6.14285714,   3.85714286,\n",
       "         -4.14285714,   7.85714286]])"
      ]
     },
     "execution_count": 165,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "centered.T"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 166,
   "id": "0d7ebc2e",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "array([[ 25,  77, 175,  10],\n",
       "       [ 31, 110, 195,  12],\n",
       "       [ 15,  70, 172,   2],\n",
       "       [ 20,  85, 180,  16],\n",
       "       [ 10,  65, 168,   0],\n",
       "       [ 12,  75, 173,   6],\n",
       "       [ 16,  75, 180,   3],\n",
       "       [ 26,  63, 165,   2],\n",
       "       [ 15,  55, 158,   5],\n",
       "       [ 21,  66, 163,  14],\n",
       "       [ 30,  95, 190,   1],\n",
       "       [ 13,  72, 172,  11],\n",
       "       [  8,  83, 185,   3],\n",
       "       [ 12, 115, 192,  15]], dtype=int64)"
      ]
     },
     "execution_count": 166,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "matrix"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 167,
   "id": "86bf21f0",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "array([[ 25,  31,  15,  20,  10,  12,  16,  26,  15,  21,  30,  13,   8,\n",
       "         12],\n",
       "       [ 77, 110,  70,  85,  65,  75,  75,  63,  55,  66,  95,  72,  83,\n",
       "        115],\n",
       "       [175, 195, 172, 180, 168, 173, 180, 165, 158, 163, 190, 172, 185,\n",
       "        192],\n",
       "       [ 10,  12,   2,  16,   0,   6,   3,   2,   5,  14,   1,  11,   3,\n",
       "         15]], dtype=int64)"
      ]
     },
     "execution_count": 167,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "matrix.T"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 168,
   "id": "09dd036a",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "array([[  5330,  20514,  45039,   1890],\n",
       "       [ 20514,  91302, 197372,   8451],\n",
       "       [ 45039, 197372, 436718,  17811],\n",
       "       [  1890,   8451,  17811,   1130]], dtype=int64)"
      ]
     },
     "execution_count": 168,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "matrix.T.dot(matrix)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 169,
   "id": "34f36ce2",
   "metadata": {},
   "outputs": [
    {
     "ename": "AttributeError",
     "evalue": "'numpy.ndarray' object has no attribute 'iloc'",
     "output_type": "error",
     "traceback": [
      "\u001b[1;31m---------------------------------------------------------------------------\u001b[0m",
      "\u001b[1;31mAttributeError\u001b[0m                            Traceback (most recent call last)",
      "Cell \u001b[1;32mIn[169], line 1\u001b[0m\n\u001b[1;32m----> 1\u001b[0m \u001b[43mmatrix\u001b[49m\u001b[38;5;241;43m.\u001b[39;49m\u001b[43mT\u001b[49m\u001b[38;5;241;43m.\u001b[39;49m\u001b[43mdot\u001b[49m\u001b[43m(\u001b[49m\u001b[43mmatrix\u001b[49m\u001b[43m)\u001b[49m\u001b[38;5;241;43m.\u001b[39;49m\u001b[43miloc\u001b[49m[:,\u001b[38;5;241m0\u001b[39m]\n",
      "\u001b[1;31mAttributeError\u001b[0m: 'numpy.ndarray' object has no attribute 'iloc'"
     ]
    }
   ],
   "source": [
    "matrix.T.dot(matrix).iloc[:,0]"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 170,
   "id": "8c6e31db",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "array([ 5330, 20514, 45039,  1890], dtype=int64)"
      ]
     },
     "execution_count": 170,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "matrix.T.dot(matrix)[:,0]"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 171,
   "id": "48a52598",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "array([ 5330, 20514, 45039,  1890], dtype=int64)"
      ]
     },
     "execution_count": 171,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "matrix.T.dot(matrix)[:,0].T"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 172,
   "id": "048dc6a5",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "(4,)"
      ]
     },
     "execution_count": 172,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "matrix.T.dot(matrix)[:,0].shape"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 173,
   "id": "e30821f0",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "array([[ 5330],\n",
       "       [20514],\n",
       "       [45039],\n",
       "       [ 1890]], dtype=int64)"
      ]
     },
     "execution_count": 173,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "matrix.T.dot(matrix)[:,0].reshape(-1,1)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 174,
   "id": "0831613d",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "array([[ 25,  31,  15,  20,  10,  12,  16,  26,  15,  21,  30,  13,   8,\n",
       "         12],\n",
       "       [ 77, 110,  70,  85,  65,  75,  75,  63,  55,  66,  95,  72,  83,\n",
       "        115],\n",
       "       [175, 195, 172, 180, 168, 173, 180, 165, 158, 163, 190, 172, 185,\n",
       "        192],\n",
       "       [ 10,  12,   2,  16,   0,   6,   3,   2,   5,  14,   1,  11,   3,\n",
       "         15]], dtype=int64)"
      ]
     },
     "execution_count": 174,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "matrix.T"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 175,
   "id": "6c901106",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "array([[ 25,  77, 175,  10],\n",
       "       [ 31, 110, 195,  12],\n",
       "       [ 15,  70, 172,   2],\n",
       "       [ 20,  85, 180,  16],\n",
       "       [ 10,  65, 168,   0],\n",
       "       [ 12,  75, 173,   6],\n",
       "       [ 16,  75, 180,   3],\n",
       "       [ 26,  63, 165,   2],\n",
       "       [ 15,  55, 158,   5],\n",
       "       [ 21,  66, 163,  14],\n",
       "       [ 30,  95, 190,   1],\n",
       "       [ 13,  72, 172,  11],\n",
       "       [  8,  83, 185,   3],\n",
       "       [ 12, 115, 192,  15]], dtype=int64)"
      ]
     },
     "execution_count": 175,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "matrix"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 176,
   "id": "2e7c0fc2",
   "metadata": {
    "scrolled": true
   },
   "outputs": [
    {
     "data": {
      "text/plain": [
       "((4, 14), (14, 4))"
      ]
     },
     "execution_count": 176,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "matrix.T.shape,matrix.shape"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 177,
   "id": "b35deb93",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "((14, 4), (4, 14))"
      ]
     },
     "execution_count": 177,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "matrix.shape,matrix.T.shape"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 178,
   "id": "97c50e42",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "(4, 4)"
      ]
     },
     "execution_count": 178,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "matrix.T.dot(matrix).shape"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 179,
   "id": "77ff7e39",
   "metadata": {
    "scrolled": true
   },
   "outputs": [
    {
     "data": {
      "text/plain": [
       "((4, 14), (14, 4))"
      ]
     },
     "execution_count": 179,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "matrix.T.shape,matrix.shape"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 180,
   "id": "928e4ecd",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "array([[ 25,  31,  15,  20,  10,  12,  16,  26,  15,  21,  30,  13,   8,\n",
       "         12],\n",
       "       [ 77, 110,  70,  85,  65,  75,  75,  63,  55,  66,  95,  72,  83,\n",
       "        115],\n",
       "       [175, 195, 172, 180, 168, 173, 180, 165, 158, 163, 190, 172, 185,\n",
       "        192],\n",
       "       [ 10,  12,   2,  16,   0,   6,   3,   2,   5,  14,   1,  11,   3,\n",
       "         15]], dtype=int64)"
      ]
     },
     "execution_count": 180,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "matrix.T"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 181,
   "id": "cbd4c476",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "array([[ 25,  77, 175,  10],\n",
       "       [ 31, 110, 195,  12],\n",
       "       [ 15,  70, 172,   2],\n",
       "       [ 20,  85, 180,  16],\n",
       "       [ 10,  65, 168,   0],\n",
       "       [ 12,  75, 173,   6],\n",
       "       [ 16,  75, 180,   3],\n",
       "       [ 26,  63, 165,   2],\n",
       "       [ 15,  55, 158,   5],\n",
       "       [ 21,  66, 163,  14],\n",
       "       [ 30,  95, 190,   1],\n",
       "       [ 13,  72, 172,  11],\n",
       "       [  8,  83, 185,   3],\n",
       "       [ 12, 115, 192,  15]], dtype=int64)"
      ]
     },
     "execution_count": 181,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "matrix"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 182,
   "id": "db6f42ea",
   "metadata": {
    "collapsed": true
   },
   "outputs": [
    {
     "data": {
      "text/plain": [
       "((4, 14),\n",
       " array([[ 25,  77, 175,  10],\n",
       "        [ 31, 110, 195,  12],\n",
       "        [ 15,  70, 172,   2],\n",
       "        [ 20,  85, 180,  16],\n",
       "        [ 10,  65, 168,   0],\n",
       "        [ 12,  75, 173,   6],\n",
       "        [ 16,  75, 180,   3],\n",
       "        [ 26,  63, 165,   2],\n",
       "        [ 15,  55, 158,   5],\n",
       "        [ 21,  66, 163,  14],\n",
       "        [ 30,  95, 190,   1],\n",
       "        [ 13,  72, 172,  11],\n",
       "        [  8,  83, 185,   3],\n",
       "        [ 12, 115, 192,  15]], dtype=int64))"
      ]
     },
     "execution_count": 182,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "matrix.T.shape,matrix"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 183,
   "id": "307f3e37",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "array([[  5330,  20514,  45039,   1890],\n",
       "       [ 20514,  91302, 197372,   8451],\n",
       "       [ 45039, 197372, 436718,  17811],\n",
       "       [  1890,   8451,  17811,   1130]], dtype=int64)"
      ]
     },
     "execution_count": 183,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "matrix.T.dot(matrix)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 1,
   "id": "44eeec88",
   "metadata": {},
   "outputs": [
    {
     "ename": "NameError",
     "evalue": "name 'np' is not defined",
     "output_type": "error",
     "traceback": [
      "\u001b[1;31m---------------------------------------------------------------------------\u001b[0m",
      "\u001b[1;31mNameError\u001b[0m                                 Traceback (most recent call last)",
      "Cell \u001b[1;32mIn[1], line 1\u001b[0m\n\u001b[1;32m----> 1\u001b[0m arr \u001b[38;5;241m=\u001b[39m \u001b[43mnp\u001b[49m\u001b[38;5;241m.\u001b[39marrange(\u001b[38;5;241m15\u001b[39m)\n",
      "\u001b[1;31mNameError\u001b[0m: name 'np' is not defined"
     ]
    }
   ],
   "source": [
    "arr = np.arrange(15)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 2,
   "id": "f835436e",
   "metadata": {},
   "outputs": [],
   "source": [
    "import numpy as np"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 3,
   "id": "fa28a4e7",
   "metadata": {},
   "outputs": [
    {
     "ename": "AttributeError",
     "evalue": "module 'numpy' has no attribute 'arrange'",
     "output_type": "error",
     "traceback": [
      "\u001b[1;31m---------------------------------------------------------------------------\u001b[0m",
      "\u001b[1;31mAttributeError\u001b[0m                            Traceback (most recent call last)",
      "Cell \u001b[1;32mIn[3], line 1\u001b[0m\n\u001b[1;32m----> 1\u001b[0m \u001b[43mnp\u001b[49m\u001b[38;5;241;43m.\u001b[39;49m\u001b[43marrange\u001b[49m(\u001b[38;5;241m15\u001b[39m)\n",
      "File \u001b[1;32mD:\\miniconda3\\envs\\pydata-book\\lib\\site-packages\\numpy\\__init__.py:320\u001b[0m, in \u001b[0;36m__getattr__\u001b[1;34m(attr)\u001b[0m\n\u001b[0;32m    317\u001b[0m     \u001b[38;5;28;01mfrom\u001b[39;00m \u001b[38;5;21;01m.\u001b[39;00m\u001b[38;5;21;01mtesting\u001b[39;00m \u001b[38;5;28;01mimport\u001b[39;00m Tester\n\u001b[0;32m    318\u001b[0m     \u001b[38;5;28;01mreturn\u001b[39;00m Tester\n\u001b[1;32m--> 320\u001b[0m \u001b[38;5;28;01mraise\u001b[39;00m \u001b[38;5;167;01mAttributeError\u001b[39;00m(\u001b[38;5;124m\"\u001b[39m\u001b[38;5;124mmodule \u001b[39m\u001b[38;5;132;01m{!r}\u001b[39;00m\u001b[38;5;124m has no attribute \u001b[39m\u001b[38;5;124m\"\u001b[39m\n\u001b[0;32m    321\u001b[0m                      \u001b[38;5;124m\"\u001b[39m\u001b[38;5;132;01m{!r}\u001b[39;00m\u001b[38;5;124m\"\u001b[39m\u001b[38;5;241m.\u001b[39mformat(\u001b[38;5;18m__name__\u001b[39m, attr))\n",
      "\u001b[1;31mAttributeError\u001b[0m: module 'numpy' has no attribute 'arrange'"
     ]
    }
   ],
   "source": [
    "np.arrange(15)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 4,
   "id": "506b478d",
   "metadata": {},
   "outputs": [],
   "source": [
    "arr = np.arange(15)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 5,
   "id": "119f309a",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "array([ 0,  1,  2,  3,  4,  5,  6,  7,  8,  9, 10, 11, 12, 13, 14])"
      ]
     },
     "execution_count": 5,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "arr"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 6,
   "id": "fa839c15",
   "metadata": {},
   "outputs": [],
   "source": [
    "arr = np.arange(15).reshape((3,5))"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 7,
   "id": "071ad284",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "array([[ 0,  1,  2,  3,  4],\n",
       "       [ 5,  6,  7,  8,  9],\n",
       "       [10, 11, 12, 13, 14]])"
      ]
     },
     "execution_count": 7,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "arr"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 8,
   "id": "9faa03a8",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "array([[ 0,  1,  2],\n",
       "       [ 3,  4,  5],\n",
       "       [ 6,  7,  8],\n",
       "       [ 9, 10, 11],\n",
       "       [12, 13, 14]])"
      ]
     },
     "execution_count": 8,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "arr.reshape((5,3))"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 9,
   "id": "5fbb3c79",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "array([[ 0,  1,  2,  3,  4],\n",
       "       [ 5,  6,  7,  8,  9],\n",
       "       [10, 11, 12, 13, 14]])"
      ]
     },
     "execution_count": 9,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "arr"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 10,
   "id": "8a93bd67",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "array([[ 0,  5, 10],\n",
       "       [ 1,  6, 11],\n",
       "       [ 2,  7, 12],\n",
       "       [ 3,  8, 13],\n",
       "       [ 4,  9, 14]])"
      ]
     },
     "execution_count": 10,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "arr.T"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 11,
   "id": "51c29c89",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "array([[ 0,  1,  2,  3,  4],\n",
       "       [ 5,  6,  7,  8,  9],\n",
       "       [10, 11, 12, 13, 14]])"
      ]
     },
     "execution_count": 11,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "arr"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 12,
   "id": "37ff3642",
   "metadata": {},
   "outputs": [
    {
     "ename": "ValueError",
     "evalue": "matmul: Input operand 1 has a mismatch in its core dimension 0, with gufunc signature (n?,k),(k,m?)->(n?,m?) (size 3 is different from 5)",
     "output_type": "error",
     "traceback": [
      "\u001b[1;31m---------------------------------------------------------------------------\u001b[0m",
      "\u001b[1;31mValueError\u001b[0m                                Traceback (most recent call last)",
      "Cell \u001b[1;32mIn[12], line 1\u001b[0m\n\u001b[1;32m----> 1\u001b[0m \u001b[43marr\u001b[49m\u001b[43m \u001b[49m\u001b[38;5;241;43m@\u001b[39;49m\u001b[43m \u001b[49m\u001b[43marr\u001b[49m\n",
      "\u001b[1;31mValueError\u001b[0m: matmul: Input operand 1 has a mismatch in its core dimension 0, with gufunc signature (n?,k),(k,m?)->(n?,m?) (size 3 is different from 5)"
     ]
    }
   ],
   "source": [
    "arr @ arr"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 13,
   "id": "e494f5c7",
   "metadata": {},
   "outputs": [
    {
     "ename": "ValueError",
     "evalue": "shapes (3,5) and (3,5) not aligned: 5 (dim 1) != 3 (dim 0)",
     "output_type": "error",
     "traceback": [
      "\u001b[1;31m---------------------------------------------------------------------------\u001b[0m",
      "\u001b[1;31mValueError\u001b[0m                                Traceback (most recent call last)",
      "Cell \u001b[1;32mIn[13], line 1\u001b[0m\n\u001b[1;32m----> 1\u001b[0m \u001b[43marr\u001b[49m\u001b[38;5;241;43m.\u001b[39;49m\u001b[43mdot\u001b[49m\u001b[43m(\u001b[49m\u001b[43marr\u001b[49m\u001b[43m)\u001b[49m\n",
      "\u001b[1;31mValueError\u001b[0m: shapes (3,5) and (3,5) not aligned: 5 (dim 1) != 3 (dim 0)"
     ]
    }
   ],
   "source": [
    "arr.dot(arr)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 4,
   "id": "5e352b27",
   "metadata": {
    "scrolled": true
   },
   "outputs": [],
   "source": [
    "import os\n",
    "housing_path = os.path.join(\"datasets\",\"housing\")"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 5,
   "id": "ec488b60",
   "metadata": {
    "scrolled": true
   },
   "outputs": [],
   "source": [
    "os.makedirs(housing_path,exist_ok=True)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "id": "f11cb8ee",
   "metadata": {},
   "outputs": [],
   "source": []
  }
 ],
 "metadata": {
  "kernelspec": {
   "display_name": "Python 3 (ipykernel)",
   "language": "python",
   "name": "python3"
  },
  "language_info": {
   "codemirror_mode": {
    "name": "ipython",
    "version": 3
   },
   "file_extension": ".py",
   "mimetype": "text/x-python",
   "name": "python",
   "nbconvert_exporter": "python",
   "pygments_lexer": "ipython3",
   "version": "3.8.20"
  }
 },
 "nbformat": 4,
 "nbformat_minor": 5
}
